예제 #1
0
파일: YagDriver.php 프로젝트: kabarakh/yag
 protected function getYAGObjectInfoByPathInfo(PathInfo $pathInfo)
 {
     switch ($pathInfo->getPathType()) {
         case PathInfo::INFO_PID:
             return array('name' => $pathInfo->getDisplayName() . '|' . $pathInfo->getPid(), 'identifier' => $pathInfo->getIdentifier(), 'storage' => $this->storage->getUid());
             break;
         case PathInfo::INFO_GALLERY:
             $gallery = $this->galleryRepository->findByUid($pathInfo->getGalleryUId());
             if ($gallery instanceof \Tx_Yag_Domain_Model_Gallery) {
                 return $this->buildGalleryObjectInfo($pathInfo, $gallery);
             }
             break;
         case PathInfo::INFO_ALBUM:
             $album = $this->albumRepository->findByUid($pathInfo->getAlbumUid());
             if ($album instanceof \Tx_Yag_Domain_Model_Album) {
                 return $this->buildAlbumObjectInfo($pathInfo, $album);
             }
             break;
         case PathInfo::INFO_ITEM:
             $item = $this->itemRepository->findByUid($pathInfo->getItemUid());
             if ($item instanceof \Tx_Yag_Domain_Model_Item) {
                 return $this->buildItemObjectInfo($pathInfo, $item);
             }
             break;
     }
     return false;
 }
예제 #2
0
 /**
  * Deletes given album
  *
  * @param Tx_Yag_Domain_Model_Album $album
  * @rbacNeedsAccess
  * @rbacObject Album
  * @rbacAction delete
  */
 public function deleteAlbumAction(Tx_Yag_Domain_Model_Album $album)
 {
     $album->delete();
     $this->albumRepository->syncTranslatedAlbums();
     $this->returnDataAndShutDown();
 }
예제 #3
0
 /**
  * Sets hidden property of album to 0.
  *
  * @param Tx_Yag_Domain_Model_Album $album Album to set hidden property for
  * @rbacNeedsAccess
  * @rbacObject Album
  * @rbacAction edit
  */
 public function unhideAlbumAction(Tx_Yag_Domain_Model_Album $album)
 {
     $album->setHidden(0);
     $this->albumRepository->update($album);
     $this->returnDataAndShutDown();
 }