Added ability to add extensions to LeftAndMain, and supply and augmentInit method on them

Added the ability to define getCMSTreeTitle in a LeftAndMain extension to change the main title at the top of the tree

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@40222 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2007-08-16 06:25:17 +00:00
parent 287f0990fc
commit 79f5bd5db4
1 changed files with 9 additions and 1 deletions

View File

@ -68,6 +68,9 @@ abstract class LeftAndMain extends Controller {
Requirements::javascript('sapphire/javascript/Validator.js');
Requirements::css("sapphire/css/SubmittedFormReportField.css");
$dummy = null;
$this->extend('augmentInit', $dummy);
}
/**
@ -286,7 +289,12 @@ abstract class LeftAndMain extends Controller {
if(!$rootID) {
$rootLink = $this->Link() . '0';
$siteTree = "<ul id=\"sitetree\" class=\"tree unformatted\"><li id=\"record-0\" class=\"Root nodelete\"><a href=\"$rootLink\">Site Content</a>"
// This lets us override the tree title with an extension
if($this->hasMethod('getCMSTreeTitle')) $treeTitle = $this->getCMSTreeTitle();
else $treeTitle = "Site Content";
$siteTree = "<ul id=\"sitetree\" class=\"tree unformatted\"><li id=\"record-0\" class=\"Root nodelete\"><a href=\"$rootLink\">$treeTitle</a>"
. $siteTree . "</li></ul>";
}