Esempio n. 1
0
 /**
  * tx_adgallery_pi1::getAllItems()
  *
  * @return
  */
 public function getAllItems()
 {
     $res = null;
     switch ($this->conf['displayType']) {
         case '1':
             if (version_compare(TYPO3_version, '6.2.0', '<')) {
                 // dam mod
                 $res = $this->getAllImagesFromDirectory($this->conf['imagespath']);
             } else {
                 // fal mode
                 if (!empty($this->conf['imagespath']) && preg_match('/^(\\d+):(.*)$/', $this->conf['imagespath'], $matches)) {
                     $storageUid = (int) $matches[1];
                     $rootIdentifier = $matches[2];
                     $res = \TYPO3\CMS\Core\Resource\Collection\FolderBasedFileCollection::create(array('storage' => $storageUid, 'folder' => $rootIdentifier), true);
                 }
             }
             break;
         case '2':
             $res = $this->getAllImagesFromCategory($this->conf['damcategory']);
             break;
         case '4':
             $res = $this->getAllImagesFromSysCategory($this->conf['syscategory']);
             break;
     }
     return $res;
 }
 /**
  * Creates a collection object.
  *
  * @param array $collectionData The database row of the sys_file_collection record.
  * @return \TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection
  */
 public function createCollectionObject(array $collectionData)
 {
     switch ($collectionData['type']) {
         case 'static':
             $collection = \TYPO3\CMS\Core\Resource\Collection\StaticFileCollection::create($collectionData);
             break;
         case 'folder':
             $collection = \TYPO3\CMS\Core\Resource\Collection\FolderBasedFileCollection::create($collectionData);
             break;
         default:
             $collection = NULL;
     }
     return $collection;
 }