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:
Andrew O'Neil 2008-09-01 04:45:38 +00:00
parent 56a921cd2d
commit 770bdfa42b

View File

@ -1246,7 +1246,6 @@ class SiteTree extends DataObject {
}
if($this->stagesDiffer('Stage', 'Live')) {
if($this->isPublished() && $this->canEdit()) {
$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"));
@ -1255,9 +1254,13 @@ class SiteTree extends DataObject {
}
}
if($this->canPublish())
if($this->canPublish()) {
$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);
}