Skip to content
This repository
Browse code

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
Ingo Schommer authored
10  code/controllers/CMSPagesController.php
@@ -10,12 +10,20 @@ class CMSPagesController extends CMSMain {
10 10
 	static $url_priority = 40;
11 11
 	static $menu_title = 'Pages';	
12 12
 	static $required_permission_codes = 'CMS_ACCESS_CMSMain';
13  
-	
  13
+
14 14
 	function PreviewLink() {
15 15
 		return false;
16 16
 	}
17 17
 
  18
+	/**
  19
+	 * Doesn't deal with a single record, and we need
  20
+	 * to avoid session state from previous record edits leaking in here.
  21
+	 */
18 22
 	public function currentPageID() {
19 23
 		return false;
20 24
 	}
  25
+
  26
+	public function isCurrentPage(DataObject $record) {
  27
+		return false;
  28
+	}
21 29
 }
7  code/model/SiteTree.php
@@ -2531,11 +2531,9 @@ public function Level($level) {
2531 2531
 	/**
2532 2532
 	 * Return the CSS classes to apply to this node in the CMS tree
2533 2533
 	 *
2534  
-	 * @param Controller $controller The controller object that the tree
2535  
-	 *                               appears on
2536 2534
 	 * @return string
2537 2535
 	 */
2538  
-	function CMSTreeClasses($controller) {
  2536
+	function CMSTreeClasses() {
2539 2537
 		$classes = sprintf('class-%s', $this->class);
2540 2538
 		if($this->HasBrokenFile || $this->HasBrokenLink)
2541 2539
 			$classes .= " BrokenLink";
@@ -2543,9 +2541,6 @@ function CMSTreeClasses($controller) {
2543 2541
 		if(!$this->canAddChildren())
2544 2542
 			$classes .= " nochildren";
2545 2543
 
2546  
-		if($controller->isCurrentPage($this))
2547  
-			$classes .= " current";
2548  
-
2549 2544
 		if(!$this->canEdit() && !$this->canAddChildren()) 
2550 2545
 			$classes .= " disabled";
2551 2546
 
4  code/model/VirtualPage.php
@@ -348,8 +348,8 @@ function updateImageTracking() {
348 348
 		$this->ImageTracking()->setByIdList($this->CopyContentFrom()->ImageTracking()->column('ID'));
349 349
 	}
350 350
 
351  
-	function CMSTreeClasses($controller) {
352  
-		return parent::CMSTreeClasses($controller) . ' VirtualPage-' . $this->CopyContentFrom()->ClassName;
  351
+	function CMSTreeClasses() {
  352
+		return parent::CMSTreeClasses() . ' VirtualPage-' . $this->CopyContentFrom()->ClassName;
353 353
 	}
354 354
 	
355 355
 	/**

0 notes on commit 0f7dd79

Please sign in to comment.
Something went wrong with that request. Please try again.