/** * Validates the get entry preview action. */ public function validateGetEntryPreview() { $this->viewableEntry = ViewableEntry::getEntry(reset($this->objectIDs)); if ($this->viewableEntry === null || !$this->viewableEntry->canRead()) { throw new PermissionDeniedException(); } }
/** * @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(); } }
/** * @inheritDoc */ public function getOutstandingItemCount($objectID = null) { return ViewableEntry::getUnreadEntries(); }
/** * @see \wcf\page\IPage::assignVariables() */ public function assignVariables() { parent::assignVariables(); WCF::getTPL()->assign(array('entry' => $this->entry, 'entryID' => $this->entryID, 'userProfile' => $this->userProfile, 'commentCanAdd' => WCF::getUser()->userID && WCF::getSession()->getPermission('user.linklist.canAddComment'), 'commentList' => $this->commentList, 'commentObjectTypeID' => $this->commentObjectTypeID, 'lastCommentTime' => $this->commentList ? $this->commentList->getMinCommentTime() : 0, 'likeData' => MODULE_LIKE && $this->commentList ? $this->commentList->getLikeData() : array(), 'userEntryList' => $this->userEntryList, 'tags' => $this->tags, 'entryLikeData' => $this->entryLikeData, 'attachmentList' => $this->entry->getAttachments(), 'allowSpidersToIndexThisPage' => true)); }