Beispiel #1
0
 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;
 }
Beispiel #2
0
 /**
  * Deletes given gallery
  *
  * @param Tx_Yag_Domain_Model_Gallery $gallery
  * @rbacNeedsAccess
  * @rbacObject Gallery
  * @rbacAction delete
  */
 public function deleteGalleryAction(Tx_Yag_Domain_Model_Gallery $gallery)
 {
     $gallery->delete();
     $this->galleryRepository->syncTranslatedGalleries();
     $this->returnDataAndShutDown();
 }
Beispiel #3
0
 /**
  * Sets album as gallery thumb for each gallery associated with given album
  * 
  * @param Tx_Yag_Domain_Model_Album $album Album to set as thumb for all galleries associated with this album
  * @rbacNeedsAccess
  * @rbacObject Gallery
  * @rbacAction edit
  */
 public function setAlbumAsGalleryThumbAction(Tx_Yag_Domain_Model_Album $album)
 {
     $album->getGallery()->setThumbAlbum($album);
     $this->galleryRepository->update($album->getGallery());
     $this->returnDataAndShutDown();
 }