Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 /**
  * Updates sorting of galleries
  * @rbacNeedsAccess
  * @rbacObject Gallery
  * @rbacAction edit
  */
 public function updateGallerySortingAction()
 {
     $order = GeneralUtility::_POST('galleryUid');
     foreach ($order as $index => $galleryUid) {
         $gallery = $this->galleryRepository->findByUid($galleryUid);
         /* @var $gallery Tx_Yag_Domain_Model_Gallery */
         $gallery->setSorting($index);
         $this->galleryRepository->update($gallery);
     }
     $this->returnDataAndShutDown();
 }