/** * Sets breadcrumbs for the given page. * * @param \cms\data\page\Page $page */ public static function setBreadcrumbs(Page $page) { if (PageMenu::getInstance()->getLandingPage()->getProcessor() instanceof CMSPageMenuItemProvider) { $pageID = PageMenu::getInstance()->getLandingPage()->getProcessor()->getPage()->pageID; } if (isset($pageID) && $pageID == $page->pageID) { WCF::getBreadcrumbs()->remove(0); } // add breadcrumbs foreach ($page->getParentPages() as $child) { WCF::getBreadcrumbs()->add($child->getBreadcrumb()); } }
/** * @see \wcf\page\IPage::assignVariables() */ public function assignVariables() { parent::assignVariables(); WCF::getTPL()->assign(array('contentNodeTree' => $this->contentNodeTree, 'sidebarNodeTree' => $this->sidebarNodeTree, 'page' => $this->page, 'likeData' => MODULE_LIKE && $this->commentList ? $this->commentList->getLikeData() : array(), 'commentCanAdd' => WCF::getUser()->userID && $this->page->getPermission('canAddComment'), 'commentList' => $this->commentList, 'commentObjectTypeID' => $this->commentObjectTypeID, 'lastCommentTime' => $this->commentList ? $this->commentList->getMinCommentTime() : 0, 'allowSpidersToIndexThisPage' => $this->page->allowIndexing)); // sidebar WCF::getTPL()->assign(array('sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'de.codequake.cms.page'), 'sidebarName' => 'de.codequake.cms.page')); }
/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // overwrite page list $pageNodeTree = new DrainedPageNodeTree(null, $this->pageID); $this->pageList = $pageNodeTree->getIterator(); // read page node list for 'choose page' button $choosePageNodeTree = new PageNodeTree(); $this->choosePageNodeList = $choosePageNodeTree->getIterator(); if (empty($_POST)) { // general data I18nHandler::getInstance()->setOptions('title', PACKAGE_ID, $this->page->title, 'cms.page.title\\d+'); $this->alias = $this->page->alias; I18nHandler::getInstance()->setOptions('description', PACKAGE_ID, $this->page->description, 'cms.page.description\\d+'); // meta information I18nHandler::getInstance()->setOptions('metaDescription', PACKAGE_ID, $this->page->metaDescription, 'cms.page.metaDescription\\d+'); I18nHandler::getInstance()->setOptions('metaKeywords', PACKAGE_ID, $this->page->metaKeywords, 'cms.page.metaKeywords\\d+'); $this->allowIndexing = $this->page->allowIndexing; // position $this->parentID = $this->page->parentID; $this->showOrder = $this->page->showOrder; $this->invisible = $this->page->invisible; // publication if (!$this->page->isPublished) { $this->enableDelayedPublication = 1; $dateTime = DateUtil::getDateTimeByTimestamp($this->page->publicationDate); $dateTime->setTimezone(WCF::getUser()->getTimeZone()); $this->publicationDate = $dateTime->format('c'); } if ($this->page->deactivationDate) { $this->enableDelayedDeactivation = 1; $dateTime = DateUtil::getDateTimeByTimestamp($this->page->deactivationDate); $dateTime->setTimezone(WCF::getUser()->getTimeZone()); $this->deactivationDate = $dateTime->format('c'); } // settings $this->menuItemID = $this->page->menuItemID; $this->isCommentable = $this->page->isCommentable; $this->availableDuringOfflineMode = $this->page->availableDuringOfflineMode; $this->allowSubscribing = $this->page->allowSubscribing; // display $this->styleID = $this->page->styleID; $this->stylesheetIDs = $this->page->getStylesheetIDs(); // display settings $this->sidebarOrientation = $this->page->sidebarOrientation; } }