MINOR Formatting and documentation in LeftAndMain.php

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92748 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 03:16:48 +00:00
parent bcd0bcfd1f
commit 31c2aa9de8

View File

@ -314,7 +314,6 @@ class LeftAndMain extends Controller {
);
}
/**
* Returns the menu title for the given LeftAndMain subclass.
* Implemented static so that we can get this value without instantiating an object.
@ -353,8 +352,8 @@ class LeftAndMain extends Controller {
// Main UI components
/**
* Returns the main menu of the CMS. This is also used by init() to work out which sections the user
* has access to.
* Returns the main menu of the CMS. This is also used by init()
* to work out which sections the user has access to.
*
* @return DataObjectSet
*/
@ -392,7 +391,8 @@ class LeftAndMain extends Controller {
// already set in CMSMenu::populate_menu(), but from a static pre-controller
// context, so doesn't respect the current user locale in _t() calls - as a workaround,
// we simply call LeftAndMain::menu_title_for_class() again if we're dealing with a controller
// we simply call LeftAndMain::menu_title_for_class() again
// if we're dealing with a controller
if($menuItem->controller) {
$defaultTitle = LeftAndMain::menu_title_for_class($menuItem->controller);
$title = _t("{$menuItem->controller}.MENUTITLE", $defaultTitle);
@ -414,7 +414,6 @@ class LeftAndMain extends Controller {
return $menu;
}
public function CMSTopMenu() {
return $this->renderWith(array('CMSTopMenu_alternative','CMSTopMenu'));
}
@ -447,7 +446,8 @@ class LeftAndMain extends Controller {
}
/**
* Get a site tree displaying the nodes under the given objects
* Get a site tree displaying the nodes under the given objects.
*
* @param $className The class of the root object
* @param $rootID The ID of the root object. If this is null then a complete tree will be
* shown
@ -476,10 +476,11 @@ class LeftAndMain extends Controller {
// getChildrenAsUL is a flexible and complex way of traversing the tree
$titleEval = '
"<li id=\"record-$child->ID\" class=\"" . $child->CMSTreeClasses($extraArg) . "\">" .
"<a href=\"" . Director::link(substr($extraArg->Link(),0,-1), "show", $child->ID) . "\" class=\"" . $child->CMSTreeClasses($extraArg) . "\" title=\"' . _t('LeftAndMain.PAGETYPE','Page type: ') . '".$child->class."\" >" .
($child->TreeTitle) .
"<a href=\"" . Director::link(substr($extraArg->Link(),0,-1), "show", $child->ID) . "\" class=\"" . $child->CMSTreeClasses($extraArg) . "\" title=\"'
. _t('LeftAndMain.PAGETYPE','Page type: ')
. '".$child->class."\" >" . ($child->TreeTitle) .
"</a>"
';
';
$siteTree = $obj->getChildrenAsUL(
"",
$titleEval,
@ -637,8 +638,8 @@ JS;
}
/**
* Return a javascript snippet that that shows a single_instance_only page type in Create dropdownfield
* if there isn't any of its instance in the site tree
* Return a javascript snippet that that shows a single_instance_only page type
* in Create dropdownfield if there isn't any of its instance in the site tree
*/
protected function showSingleInstanceOnlyInCreateFieldJS($deletedPage) {
$className = $deletedPage->class;
@ -952,6 +953,12 @@ JS;
* @param String $logoText The logo text
*/
static $application_link = "http://www.silverstripe.org/";
/**
* @param String $name
* @param String $logoText
* @param String $link (Optional)
*/
static function setApplicationName($name, $logoText = null, $link = null) {
self::$application_name = $name;
self::$application_logo_text = $logoText ? $logoText : $name;
@ -973,6 +980,10 @@ JS;
function getApplicationLogoText() {
return self::$application_logo_text;
}
/**
* @return String
*/
function ApplicationLink() {
return self::$application_link;
}