Merge pull request #30 from frankmullenger/master

Removing Unpublish button from CMS when canDeleteFromLive() returns false
This commit is contained in:
Sam Minnée 2011-10-28 21:34:13 -07:00
commit d63bcb63ae

View File

@ -2045,7 +2045,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
return $actions;
}
if($this->isPublished() && $this->canPublish() && !$this->IsDeletedFromStage) {
if($this->isPublished() && $this->canPublish() && !$this->IsDeletedFromStage && $this->canDeleteFromLive()) {
// "unpublish"
$unpublish = FormAction::create('unpublish', _t('SiteTree.BUTTONUNPUBLISH', 'Unpublish'), 'delete');
$unpublish->describe(_t('SiteTree.BUTTONUNPUBLISHDESC', 'Remove this page from the published site'));