Esempio n. 1
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->fileID = intval($_REQUEST['id']);
     }
     $this->file = FileCache::getInstance()->getFile($this->fileID);
     if ($this->file === null) {
         throw new IllegalLinkException();
     }
     // check if image file is in cache
     if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $this->file->uploadTime && in_array($this->file->fileType, self::$inlineMimeTypes)) {
         // send 304
         header("HTTP/1.1 304 Not Modified");
         exit;
     }
 }
Esempio n. 2
0
 /**
  * @see	\cms\system\content\type\IContentType::getOutput()
  */
 public function getOutput(Content $content)
 {
     $file = FileCache::getInstance()->getFile($content->fileID);
     WCF::getTPL()->assign(array('file' => $file));
     return parent::getOutput($content);
 }
Esempio n. 3
0
 /**
  * @see	\cms\system\content\type\IContentType::getOutput()
  */
 public function getOutput(Content $content)
 {
     $image = FileCache::getInstance()->getFile($content->imageID);
     WCF::getTPL()->assign(array('image' => $image));
     return AbstractContentType::getOutput($content);
 }
Esempio n. 4
0
 public function assignVariables()
 {
     parent::assignVariables();
     if (WCF::getSession()->getPermission('user.cms.news.canStartPoll') && MODULE_POLL) {
         PollManager::getInstance()->assignVariables();
     }
     if ($this->imageID && $this->imageID != 0) {
         $this->image = FileCache::getInstance()->getFile($this->imageID);
     }
     WCF::getTPL()->assign(array('categoryList' => $this->categoryList, 'categoryIDs' => $this->categoryIDs, 'imageID' => $this->imageID, 'image' => $this->image, 'teaser' => $this->teaser, 'time' => $this->time, 'action' => $this->action, 'tags' => $this->tags, 'allowedFileExtensions' => explode("\n", StringUtil::unifyNewlines(WCF::getSession()->getPermission('user.cms.news.allowedAttachmentExtensions')))));
 }
Esempio n. 5
0
 public function getImage()
 {
     if ($this->imageID != 0) {
         return FileCache::getInstance()->getFile($this->imageID);
     }
     return null;
 }