當前位置: 首頁>>代碼示例>>PHP>>正文


PHP aTools::setCurrentPage方法代碼示例

本文整理匯總了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';
 }
開發者ID:hashir,項目名稱:UoA,代碼行數:30,代碼來源:BaseaActions.class.php

示例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');
 }
開發者ID:verenate,項目名稱:gri,代碼行數:18,代碼來源:aTools.php

示例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));
 }
開發者ID:quafzi,項目名稱:timpany-prototype,代碼行數:11,代碼來源:BaseaSlotActions.class.php

示例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);
     }
 }
開發者ID:hashir,項目名稱:UoA,代碼行數:17,代碼來源:BaseaSlotActions.class.php


注:本文中的aTools::setCurrentPage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。