mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE: Added SiteTree::doDeleteFromLive()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76723 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8c24a42cb8
commit
c05728ad30
@ -697,12 +697,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
|
||||
// if page can't be edited, don't grant delete permissions
|
||||
if(!$this->canEdit($member)) return false;
|
||||
|
||||
|
||||
$children = $this->AllChildren();
|
||||
if($children) foreach($children as $child) {
|
||||
if(!$child->canDelete($member)) return false;
|
||||
}
|
||||
|
||||
|
||||
return $this->stat('can_create') != false;
|
||||
}
|
||||
|
||||
@ -1520,6 +1520,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function doDeleteFromLive() {
|
||||
$origStage = Versioned::current_stage();
|
||||
Versioned::reading_stage('Live');
|
||||
$this->delete();
|
||||
Versioned::reading_stage($origStage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this page is new - that is, if it has yet to have been written
|
||||
|
Loading…
Reference in New Issue
Block a user