本文整理汇总了PHP中PageManager::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP PageManager::getInstance方法的具体用法?PHP PageManager::getInstance怎么用?PHP PageManager::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageManager
的用法示例。
在下文中一共展示了PageManager::getInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showIndex
function showIndex()
{
$pager = new fvPager(PageManager::getInstance());
$this->__assign('Pages', $pager->paginate(null, "IF (page_parent_id = 0, id*100000, page_parent_id*100000 + id)"));
$request = fvRequest::getInstance();
if (!($Page = PageManager::getInstance()->getByPk($request->getRequestParameter('id')))) {
$Page = new Page();
}
$this->__assign(array('Page' => $Page, 'PageManager' => PageManager::getInstance(), 'metaManager' => MetaManager::getInstance()));
return $this->__display('page_list.tpl');
}
示例2: delete
public function delete()
{
if ($this->image) {
@unlink($this->getImageRealPath());
}
$childPages = PageManager::getInstance()->getByPageParentId($this->getPk());
foreach ($childPages as $childPage) {
$childPage->page_parent_id = 0;
$childPage->save();
}
return parent::delete();
}
示例3: __construct
function __construct()
{
$currentUrl = fvRoute::getInstance()->getModuleName();
list($p) = (array) PageManager::getInstance()->getByPageUrl($currentUrl);
if (is_object($p)) {
$this->_pageInstance = $p;
} else {
fvDispatcher::redirect(fvSite::$fvConfig->get('page_404', 0, 404));
}
$this->_domInstance = new DOMDocument();
if (!$this->_domInstance->loadXML($this->_pageInstance->getPageContent())) {
fvDispatcher::redirect(fvSite::$fvConfig->get('page_error', 0, 302));
}
$this->setMeta($this->_pageInstance->getMeta());
fvSite::$Template->assign("Lang", fvLang::getInstance());
parent::__construct("main.tpl");
}
示例4: executeDelete
function executeDelete()
{
$request = fvRequest::getInstance();
if (!($Page = PageManager::getInstance()->getByPk($request->getRequestParameter('id')))) {
$this->setFlash("Ошибка при удалении.", self::$FLASH_ERROR);
} else {
$Page->getMeta()->delete();
$Page->delete();
$this->setFlash("Данные успешно удалены", self::$FLASH_SUCCESS);
}
fvResponce::getInstance()->setHeader('redirect', fvSite::$fvConfig->get('dir_web_root') . $request->getRequestParameter('module') . "/");
if (fvRequest::getInstance()->isXmlHttpRequest()) {
return self::$FV_NO_LAYOULT;
} else {
return self::$FV_OK;
}
}
示例5: route
public function route(Zend_Controller_Request_Abstract $request)
{
// Let the Rewrite router route the request first
$request = parent::route($request);
logFire("ROUTE", $request->getParam('controller'));
if ($request->getParam('controller') == '') {
// If the page param isn't set, route to default page and controller
$defaultPage = PageManager::getInstance()->getDefaultPage();
$request->setControllerName($defaultPage->pageType->controller);
$request->setParam('controller', $defaultPage->page);
$request->setParam('action', 'index');
} else {
// Route to current page's controller
$controller = PageManager::getInstance()->getPage($request->getParam('controller'));
$request->setControllerName($controller->pageType->controller);
$request->setActionName('index');
}
$request->setParam('controller', 'search');
$request->setParam('action', 'search');
return $request;
}
示例6: savePageHTML
/**
*
* @param string $pageHTML
* @param int $pageNumber
* @param string $title
* @param string $backgroundImageUrl
* @param int $spreadNumber
* @param array $properties
* @return Page Page Object
*/
public function savePageHTML($pageHTML, $pageNumber, $title = null, $backgroundImageUrl = '', $spreadNumber = null, $properties = array())
{
// Create page for the book.
$page = PageManager::getInstance()->createPage($this->bookId, $pageNumber, $backgroundImageUrl);
if (!is_null($spreadNumber)) {
$page->setSpreadPageNumber($spreadNumber);
}
if (is_null($title)) {
$page->setTitle("Untitled");
} else {
$page->setTitle($title);
//$page->setTitle($this->book_pub->publication_name);
}
if (strpos($pageHTML, "<body") === false) {
$page->setTextContent($pageHTML, false);
$pageHTML = $this->applyElementUuids($page->getPageContent());
$page->setTextContent($pageHTML, true);
} else {
$pageHTML = $this->applyElementUuids(trim($pageHTML));
$page->setTextContent($pageHTML, true);
}
$this->epub->importPage($page, $properties);
return $page;
}