Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added ability to add extensions to LeftAndMain, and supply and augmen…

…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...
commit 79f5bd5db429a8f8591f4c568270747e5c4fb371 1 parent 287f099
Sam Minnée sminnee authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 code/LeftAndMain.php
10 code/LeftAndMain.php
View
@@ -68,6 +68,9 @@ function init() {
Requirements::javascript('sapphire/javascript/Validator.js');
Requirements::css("sapphire/css/SubmittedFormReportField.css");
+
+ $dummy = null;
+ $this->extend('augmentInit', $dummy);
}
/**
@@ -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>";
}
Please sign in to comment.
Something went wrong with that request. Please try again.