Skip to content

Commit

Permalink
Added ability to add extensions to LeftAndMain, and supply and augmen…
Browse files Browse the repository at this point in the history
…tInit 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
  • Loading branch information
Sam Minnee committed Aug 16, 2007
1 parent 287f099 commit 79f5bd5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion code/LeftAndMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ function init() {
Requirements::javascript('sapphire/javascript/Validator.js');

Requirements::css("sapphire/css/SubmittedFormReportField.css");

$dummy = null;
$this->extend('augmentInit', $dummy);
}

/**
Expand Down Expand Up @@ -286,7 +289,12 @@ function getSiteTreeFor($className, $rootID = null) {

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>";
}

Expand Down

0 comments on commit 79f5bd5

Please sign in to comment.