mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
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")
This commit is contained in:
parent
75da9fd7cb
commit
0f7dd7922f
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -2531,11 +2531,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
/**
|
||||
* 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 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
if(!$this->canAddChildren())
|
||||
$classes .= " nochildren";
|
||||
|
||||
if($controller->isCurrentPage($this))
|
||||
$classes .= " current";
|
||||
|
||||
if(!$this->canEdit() && !$this->canAddChildren())
|
||||
$classes .= " disabled";
|
||||
|
||||
|
@ -348,8 +348,8 @@ class VirtualPage extends Page {
|
||||
$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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user