/** * @see \cms\system\content\type\IContentType::getFormTemplate() */ public function getFormTemplate() { $contentData = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->contentData; if (isset($contentData['imageIDs'])) { $imageList = new FileList(); $imageList->getConditionBuilder()->add('fileID in (?)', array($contentData['imageIDs'])); $imageList->readObjects(); WCF::getTPL()->assign(array('imageList' => $imageList)); } return parent::getFormTemplate(); }
/** * @see \wcf\data\IEditableObject::deleteAll() */ public static function deleteAll(array $objectIDs = array()) { $fileList = new FileList(); $fileList->setObjectIDs($objectIDs); $fileList->readObjects(); foreach ($fileList as $object) { $fileEditor = new FileEditor($object); $fileEditor->deleteFile(); } return parent::deleteAll($objectIDs); }
/** * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild() */ public function rebuild(array $parameters) { $data = array('files' => array(), 'filesToCategory' => array()); $list = new FileList(); $list->readObjects(); foreach ($data['files'] = $list->getObjects() as $file) { foreach ($file->getCategoryIDs() as $categoryID) { $data['filesToCategory'][$file->fileID] = $categoryID; } } return $data; }
protected function init() { $this->pages = PageCacheBuilder::getInstance()->getData(array(), 'pages'); $this->contents = ContentCacheBuilder::getInstance()->getData(array(), 'contents'); $list = new StylesheetList(); $list->readObjects(); $this->stylesheets = $list->getObjects(); $this->categoryObjectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.category', 'de.codequake.cms.file'); $list = new CategoryList(); $list->getConditionBuilder()->add("objectTypeID = ?", array($this->categoryObjectType->objectTypeID)); $list->readObjects(); $this->folders = $list->getObjects(); $list = new FileList(); $list->readObjects(); $this->files = $list->getObjects(); }
/** * Creates a new CategoryFileList object. * * @param array<integer> $categoryIDs * @see \wcf\data\DatabaseObjectList::__construct() */ public function __construct(array $categoryIDs) { parent::__construct(); $this->sqlJoins .= " LEFT JOIN cms" . WCF_N . "_file_to_category file_to_category ON (file.fileID = file_to_category.fileID)"; if (!empty($categoryIDs)) { $this->getConditionBuilder()->add('file_to_category.categoryID IN (?)', array($categoryIDs)); $this->getConditionBuilder()->add('file.fileID = file_to_category.fileID'); } else { $this->getConditionBuilder()->add('1=0'); } }