Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

API CHANGE Removed $controller context from SiteTree->CMSTreeClasses(…

…), now handled through closures in the specific LeftAndMain usage instead (to handle separate contexts for links and determining "current page")
  • Loading branch information...
commit 0f7dd7922fe82d6dc6f3069871bb3844d0bad70b 1 parent 75da9fd
@chillu chillu authored
View
10 code/controllers/CMSPagesController.php
@@ -10,12 +10,20 @@ class CMSPagesController extends CMSMain {
static $url_priority = 40;
static $menu_title = 'Pages';
static $required_permission_codes = 'CMS_ACCESS_CMSMain';
-
+
function PreviewLink() {
return false;
}
+ /**
+ * Doesn't deal with a single record, and we need
+ * to avoid session state from previous record edits leaking in here.
+ */
public function currentPageID() {
return false;
}
+
+ public function isCurrentPage(DataObject $record) {
+ return false;
+ }
}
View
7 code/model/SiteTree.php
@@ -2531,11 +2531,9 @@ public function Level($level) {
/**
* Return the CSS classes to apply to this node in the CMS tree
*
- * @param Controller $controller The controller object that the tree
- * appears on
* @return string
*/
- function CMSTreeClasses($controller) {
+ function CMSTreeClasses() {
$classes = sprintf('class-%s', $this->class);
if($this->HasBrokenFile || $this->HasBrokenLink)
$classes .= " BrokenLink";
@@ -2543,9 +2541,6 @@ function CMSTreeClasses($controller) {
if(!$this->canAddChildren())
$classes .= " nochildren";
- if($controller->isCurrentPage($this))
- $classes .= " current";
-
if(!$this->canEdit() && !$this->canAddChildren())
$classes .= " disabled";
View
4 code/model/VirtualPage.php
@@ -348,8 +348,8 @@ function updateImageTracking() {
$this->ImageTracking()->setByIdList($this->CopyContentFrom()->ImageTracking()->column('ID'));
}
- function CMSTreeClasses($controller) {
- return parent::CMSTreeClasses($controller) . ' VirtualPage-' . $this->CopyContentFrom()->ClassName;
+ function CMSTreeClasses() {
+ return parent::CMSTreeClasses() . ' VirtualPage-' . $this->CopyContentFrom()->ClassName;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.