/**
  * @see	\wcf\system\comment\manager\ICommentManager::isAccessible()
  */
 public function isAccessible($objectID, $validateWritePermission = false)
 {
     // check object id
     $entry = new Entry($objectID);
     if (!$entry->entryID || !$entry->canRead()) {
         return false;
     }
     return true;
 }
 /**
  * @see	\wcf\system\attachment\IAttachmentObjectType::canDelete()
  */
 public function canDelete($objectID)
 {
     if ($objectID) {
         $entry = new Entry($objectID);
         if ($entry->canEdit()) {
             return true;
         }
     }
     return false;
 }
 /**
  * @see	\wcf\system\user\object\watch\IUserObjectWatch::validateObjectID()
  */
 public function validateObjectID($objectID)
 {
     // get entry
     $entry = new Entry($objectID);
     if (!$entry->entryID) {
         throw new IllegalLinkException();
     }
     // check permission
     if (!$entry->canRead()) {
         throw new PermissionDeniedException();
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (!count($_POST)) {
         $this->teaser = $this->entry->teaser;
         $this->text = $this->entry->message;
         $this->subject = $this->entry->subject;
         $this->enableBBCodes = $this->entry->enableBBCodes;
         $this->enableHtml = $this->entry->enableHtml;
         $this->enableSmilies = $this->entry->enableSmilies;
         $this->enableComments = $this->entry->enableComments;
         $this->showSignature = $this->entry->showSignature;
         $this->languageID = $this->entry->languageID;
         $this->website = $this->entry->website;
         foreach ($this->entry->getCategories() as $category) {
             $this->categoryIDs[] = $category->categoryID;
         }
         // tagging
         if (MODULE_TAGGING) {
             $tags = TagEngine::getInstance()->getObjectTags('de.incendium.filebase.entry', $this->entry->entryID, array($this->entry->languageID));
             foreach ($tags as $tag) {
                 $this->tags[] = $tag->name;
             }
         }
     }
     //add breadcrump
     $leafCategories = $this->entry->getLeafCategories();
     $category = reset($leafCategories);
     FILEBASECore::getInstance()->setLocation($category->getParentCategories(), $category, $this->entry);
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     //add breadcrump
     $leafCategories = $this->entry->getLeafCategories();
     $category = reset($leafCategories);
     FILEBASECore::getInstance()->setLocation($category->getParentCategories(), $category, $this->entry);
 }
 /**
  * Validates parameters to load files.
  */
 public function validateLoad()
 {
     $this->readInteger('entryID');
     $this->readInteger('offset');
     // validate entry
     $this->entry = new Entry($this->parameters['entryID']);
     if (!$this->entry->entryID) {
         throw new UserInputException('entryID');
     } else {
         if (!$this->entry->canRead()) {
             throw new PermissionDeniedException();
         }
     }
 }
 /**
  * Returns the physical location of this upload.
  * 
  * @return	string
  */
 public function getLocation()
 {
     return Entry::getStorage() . 'tmp/' . $this->uploadID . '-' . $this->fileHash;
 }
 /**
  * Returns the physical location of this file.
  * 
  * @return	string
  */
 public function getLocation()
 {
     return Entry::getStorage() . substr($this->fileHash, 0, 2) . '/' . $this->fileID . '-' . $this->fileHash;
 }