本文整理汇总了PHP中aTools::setCurrentPage方法的典型用法代码示例。如果您正苦于以下问题:PHP aTools::setCurrentPage方法的具体用法?PHP aTools::setCurrentPage怎么用?PHP aTools::setCurrentPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aTools
的用法示例。
在下文中一共展示了aTools::setCurrentPage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeRevert
/**
* 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';
}
示例2: setPageEnvironment
public static function setPageEnvironment(sfAction $action, aPage $page)
{
// Title is pre-escaped as valid HTML
$prefix = aTools::getOptionI18n('title_prefix');
$action->getResponse()->setTitle($prefix . $page->getTitle(), false);
// Necessary to allow the use of
// aTools::getCurrentPage() in the layout.
// In Symfony 1.1+, you can't see $action->page from
// the layout.
aTools::setCurrentPage($page);
// Borrowed from sfSimpleCMS
if (sfConfig::get('app_a_use_bundled_layout', true)) {
$action->setLayout(sfContext::getInstance()->getConfiguration()->getTemplateDir('a', 'layout.php') . '/layout');
}
// Loading the a helper at this point guarantees not only
// helper functions but also necessary JavaScript and CSS
sfContext::getInstance()->getConfiguration()->loadHelpers('a');
}
示例3: editAjax
protected function editAjax($editorOpen)
{
// Refetch the page to reflect these changes before we
// rerender the slot
aTools::setCurrentPage(aPageTable::retrieveByIdWithSlots($this->page->id));
// Symfony 1.2 can return partials rather than templates...
// which gets us out of the "we need a template from some other
// module" bind
$variant = $this->slot->getEffectiveVariant($this->options);
return $this->renderPartial("a/ajaxUpdateSlot", array("name" => $this->name, "type" => $this->type, "permid" => $this->permid, "options" => $this->options, "editorOpen" => $editorOpen, "pageid" => $this->page->id, "variant" => $variant, "validationData" => $this->validationData));
}
示例4: editSave
/**
* DOCUMENT ME
* @return mixed
*/
protected function editSave()
{
$this->slot->save();
$this->page->newAreaVersion($this->name, $this->newSlot ? 'add' : 'update', array('permid' => $this->permid, 'slot' => $this->slot, 'top' => sfConfig::get('app_a_new_slots_top', true)));
// Refetch the page to reflect these changes before we
// rerender the slot
aTools::setCurrentPage(aPageTable::retrieveByIdWithSlots($this->page->id));
if ($this->getRequestParameter('noajax')) {
return $this->redirectToPage();
} else {
return $this->editAjax(false);
}
}