From 238f2908e5f945fd28cfeb35631f386336d42327 Mon Sep 17 00:00:00 2001 From: g4b0 Date: Thu, 30 May 2013 15:50:23 +0200 Subject: [PATCH] BUG: fixed "regression" inserted with 9281ebc64764a58f86f685f9765e1d8b60995e5a adding a new class to SiteTree elem (edit-disabled) --- code/model/SiteTree.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 293425a7..440cb1f4 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -2651,17 +2651,25 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid */ public function CMSTreeClasses() { $classes = sprintf('class-%s', $this->class); - if($this->HasBrokenFile || $this->HasBrokenLink) + if($this->HasBrokenFile || $this->HasBrokenLink) { $classes .= " BrokenLink"; + } - if(!$this->canAddChildren()) + if(!$this->canAddChildren()) { $classes .= " nochildren"; + } - if(!$this->canView() && !$this->canEdit() && !$this->canAddChildren()) - $classes .= " disabled"; + if(!$this->canEdit() && !$this->canAddChildren()) { + if (!$this->canView()) { + $classes .= " disabled"; + } else { + $classes .= " edit-disabled"; + } + } - if(!$this->ShowInMenus) + if(!$this->ShowInMenus) { $classes .= " notinmenu"; + } //TODO: Add integration /*