/** * @see \wcf\page\IPage::readData() */ public function readData() { parent::readData(); // add breadcrumbs WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms')))); if ($this->entry->isArchived) { WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news.archive'), LinkHandler::getInstance()->getLink('NewsArchive', array('application' => 'cms')))); } WCF::getBreadcrumbs()->add($this->entry->getBreadcrumb()); }
/** * @see \wcf\page\IPage::readParameters() */ public function readParameters() { parent::readParameters(); if (isset($_REQUEST['id'])) { $this->entryID = intval($_REQUEST['id']); } $this->entry = ViewableEntry::getEntry($this->entryID); if ($this->entry === null) { throw new IllegalLinkException(); } }
/** * Returns the related viewable news object * * @return \news\data\news\ViewableNews */ public function getEntry() { return ViewableEntry::getEntry($this->entryID); }
/** * @see \wcf\page\IPage::readParameters() */ public function readParameters() { parent::readParameters(); if (isset($_REQUEST['id'])) { $this->entryID = intval($_REQUEST['id']); } $this->entry = ViewableEntry::getEntry($this->entryID); if ($this->entry === null) { throw new IllegalLinkException(); } // check permission for the news if (!$this->entry->canRead()) { throw new PermissionDeniedException(); } }
/** * Validates the "getEntryPreview" action. */ public function validateGetEntryPreview() { $this->viewableEntry = ViewableEntry::getEntry(reset($this->objectIDs)); if ($this->viewableEntry === null || !$this->viewableEntry->canRead()) { throw new PermissionDeniedException(); } }