/** * DOCUMENT ME * @param sfWebRequest $request */ public function executeRevert(sfWebRequest $request) { $version = false; $subaction = $request->getParameter('subaction'); $this->preview = false; if ($subaction == 'preview') { $version = $request->getParameter('version'); $this->preview = true; } elseif ($subaction == 'revert') { $version = $request->getParameter('version'); } $id = $request->getParameter('id'); $page = aPageTable::retrieveByIdWithSlotsForVersion($id, $version); $this->flunkUnless($page); $this->name = $this->getRequestParameter('name'); $name = $this->name; $options = $this->getUser()->getAttribute("area-options-{$id}-{$name}", null, 'apostrophe'); $this->flunkUnless(isset($options['edit']) && $options['edit']); if ($subaction == 'revert') { $page->newAreaVersion($this->name, 'revert'); $page = aPageTable::retrieveByIdWithSlots($id); } aTools::setCurrentPage($page); $this->cancel = $subaction == 'cancel'; $this->revert = $subaction == 'revert'; }
/** * If culture is null you get the current user's culture, * or sf_default_culture if none is set or we're running in a task context * @param mixed $id * @param mixed $culture * @return mixed */ public static function retrieveByIdWithSlots($id, $culture = null) { return aPageTable::retrieveByIdWithSlotsForVersion($id, false, $culture); }