/**
  * Reads the list of attachments.
  */
 public function readAttachments()
 {
     if (MODULE_ATTACHMENT == 1 && !empty($this->attachmentObjectIDs)) {
         $this->attachmentList = new GroupedAttachmentList('com.woltlab.wcf.conversation.message');
         $this->attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', array($this->attachmentObjectIDs));
         $this->attachmentList->readObjects();
     }
 }
 /**
  * Gets a list of attachments.
  */
 public function readAttachments()
 {
     if (MODULE_ATTACHMENT && !empty($this->attachmentObjectIDs)) {
         $this->attachmentList = new GroupedAttachmentList('de.incendium.cms.news.entry');
         $this->attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', array($this->attachmentObjectIDs));
         $this->attachmentList->readObjects();
         // set embedded attachments
         AttachmentBBCode::setAttachmentList($this->attachmentList);
     }
 }
Exemple #3
0
 public function getAttachments()
 {
     if (MODULE_ATTACHMENT == 1 && $this->attachments) {
         $attachmentList = new GroupedAttachmentList('de.codequake.cms.news');
         $attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', array($this->newsID));
         $attachmentList->readObjects();
         $attachmentList->setPermissions(array('canDownload' => WCF::getSession()->getPermission('user.cms.news.canDownloadAttachments'), 'canViewPreview' => WCF::getSession()->getPermission('user.cms.news.canDownloadAttachments')));
         AttachmentBBCode::setAttachmentList($attachmentList);
         return $attachmentList;
     }
     return null;
 }
 /**
  * @return \wcf\data\attachment\GroupedAttachmentList
  */
 public function getAttachments()
 {
     if (MODULE_ATTACHMENT && $this->attachments) {
         $attachmentList = new GroupedAttachmentList(self::$objectType);
         $attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', array($this->{static::getDatabaseTableIndexName()}));
         $attachmentList->readObjects();
         //add permissions!
         $attachmentList->setPermissions(array('canDownload' => '', 'canViewPreview' => ''));
         AttachmentBBCode::setAttachmentList($attachmentList);
         return $attachmentList;
     }
     return;
 }
 /**
  * Assigns and returns the embedded attachments.
  * 
  * @param	boolean		$ignoreCache
  * @return	\wcf\data\attachment\GroupedAttachmentList
  */
 public function getAttachments($ignoreCache = false)
 {
     if (MODULE_ATTACHMENT == 1 && ($this->attachments || $ignoreCache)) {
         $attachmentList = new GroupedAttachmentList('com.woltlab.wcf.conversation.message');
         $attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', array($this->messageID));
         $attachmentList->readObjects();
         $attachmentList->setPermissions(array('canDownload' => true, 'canViewPreview' => true));
         if ($ignoreCache && !count($attachmentList)) {
             return null;
         }
         return $attachmentList;
     }
     return null;
 }
 /**
  * Gets and assigns embedded attachments.
  * 
  * @return	\wcf\data\attachment\GroupedAttachmentList
  */
 public function getAttachments()
 {
     if (MODULE_ATTACHMENT == 1 && $this->attachments) {
         $attachmentList = new GroupedAttachmentList('de.voolia.news.entry');
         $attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', array($this->newsID));
         $attachmentList->readObjects();
         // set embedded attachments
         AttachmentBBCode::setAttachmentList($attachmentList);
         return $attachmentList;
     }
     return null;
 }
 /**
  * Returns and assigns embedded attachments.
  * 
  * @return	\wcf\data\attachment\GroupedAttachmentList
  */
 public function getAttachments()
 {
     if (MODULE_ATTACHMENT == 1 && $this->attachments) {
         $attachmentList = new GroupedAttachmentList('de.incendium.filebase.entry');
         $attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', array($this->entryID));
         $attachmentList->readObjects();
         $attachmentList->setPermissions(array('canDownload' => WCF::getSession()->getPermission('user.filebase.canViewScreenshot'), 'canViewPreview' => WCF::getSession()->getPermission('user.filebase.canViewScreenshot')));
         // set embedded attachments
         AttachmentBBCode::setAttachmentList($attachmentList);
         return $attachmentList;
     }
     return null;
 }