API CHANGE #551: Move code from CMSMain to SiteTree

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@64350 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-10-16 03:21:49 +00:00
parent b0abb54e93
commit 156fb6cf19

View File

@ -541,11 +541,8 @@ JS;
public function revert($urlParams, $form) {
$id = $_REQUEST['ID'];
Versioned::reading_stage('Live');
$obj = DataObject::get_by_id("SiteTree", $id);
Versioned::reading_stage('Stage');
$obj->publish("Live", "Stage");
$obj->doRevertToLive();
$title = Convert::raw2js($obj->Title);
FormResponse::get_page($id);
@ -758,14 +755,7 @@ HTML;
$SQL_id = Convert::raw2sql($_REQUEST['ID']);
$page = DataObject::get_by_id("SiteTree", $SQL_id);
$page->deleteFromStage('Live');
$page->flushCache();
$page = DataObject::get_by_id("SiteTree", $SQL_id);
$page->Status = "Unpublished";
$page->write();
GoogleSitemap::ping();
$page->doUnpublish();
return $this->tellBrowserAboutPublicationChange($page, sprintf(_t('CMSMain.REMOVEDPAGE',"Removed '%s' from the published site"),$page->Title));
}
@ -805,11 +795,7 @@ HTML;
function performRollback($id, $version) {
$record = DataObject::get_by_id($this->stat('tree_class'), $id);
$record->publish($version, "Stage", true);
$record->AssignedToID = 0;
$record->RequestedByID = 0;
$record->Status = "Saved (update)";
$record->writeWithoutVersion();
$record->doRollbackTo($version);
return $record;
}