예제 #1
0
 /**
  * This is a patch for TYPO3 6.2 - can be removed for
  * TYPO3 7.0 - see parents class method
  *
  * @param int $identifier
  * @param bool $ignoreEnableFields
  * @return Tx_Yag_Domain_Model_Album
  */
 public function findByUid($identifier, $ignoreEnableFields = false)
 {
     if (Tx_PtExtbase_Div::isMinTypo3Version(7)) {
         return parent::findByUid($identifier);
     }
     if ($this->session->hasIdentifier($identifier, $this->objectType)) {
         $object = $this->session->getObjectByIdentifier($identifier, $this->objectType);
     } else {
         $query = $this->createQuery();
         $query->getQuerySettings()->setRespectStoragePage(false);
         $query->getQuerySettings()->setRespectSysLanguage(false);
         $query->getQuerySettings()->setIgnoreEnableFields($ignoreEnableFields);
         $object = $query->matching($query->equals('uid', $identifier))->execute()->getFirst();
     }
     return $object;
 }
예제 #2
0
파일: Div.php 프로젝트: beyond-agentur/yag
 /**
  * @return mixed
  */
 protected function getVersionIndependableFileMounts()
 {
     if (Tx_PtExtbase_Div::isMinTypo3Version('6.0')) {
         $fileMounts = array();
         if ($GLOBALS['BE_USER']->user['admin'] == 1) {
             $fileMounts[]['path'] = $this->getT3BasePath() . 'fileadmin/';
         }
         $fileStorages = $GLOBALS['BE_USER']->getFileStorages();
         foreach ($fileStorages as $fileStorage) {
             /** @var TYPO3\CMS\Core\Resource\ResourceStorage $fileStorage */
             $configuration = $fileStorage->getConfiguration();
             $basePath = $configuration['basePath'];
             foreach ($fileStorage->getFileMounts() as $fileMount) {
                 $relativeFolder = substr($fileMount['path'], 0, 1) === '/' ? substr($fileMount['path'], 1) : $fileMount['path'];
                 $fileMounts[]['path'] = $this->getT3BasePath() . $basePath . $relativeFolder;
             }
         }
         return $fileMounts;
     } else {
         return $GLOBALS['FILEMOUNTS'];
     }
 }