mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FEATURE #2594 - Allow decoration of getCMSActions() (simon_w)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61824 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
56a921cd2d
commit
770bdfa42b
@ -1246,7 +1246,6 @@ class SiteTree extends DataObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($this->stagesDiffer('Stage', 'Live')) {
|
if($this->stagesDiffer('Stage', 'Live')) {
|
||||||
|
|
||||||
if($this->isPublished() && $this->canEdit()) {
|
if($this->isPublished() && $this->canEdit()) {
|
||||||
$rollback = FormAction::create('rollback', _t('SiteTree.BUTTONCANCELDRAFT', 'Cancel draft changes'), 'delete');
|
$rollback = FormAction::create('rollback', _t('SiteTree.BUTTONCANCELDRAFT', 'Cancel draft changes'), 'delete');
|
||||||
$rollback->describe(_t('SiteTree.BUTTONCANCELDRAFTDESC', "Delete your draft and revert to the currently published page"));
|
$rollback->describe(_t('SiteTree.BUTTONCANCELDRAFTDESC', "Delete your draft and revert to the currently published page"));
|
||||||
@ -1255,9 +1254,13 @@ class SiteTree extends DataObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->canPublish())
|
if($this->canPublish()) {
|
||||||
$actions[] = new FormAction('publish', _t('SiteTree.BUTTONSAVEPUBLISH', 'Save & Publish'));
|
$actions[] = new FormAction('publish', _t('SiteTree.BUTTONSAVEPUBLISH', 'Save & Publish'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// getCMSActions() can be extended with updateCmsActions() on a decorator
|
||||||
|
$this->extend('updateCMSActions', $actions);
|
||||||
|
|
||||||
return new DataObjectSet($actions);
|
return new DataObjectSet($actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user