Exemplo n.º 1
0
 /**
  * Adds a new album to repository
  *
  * @param Tx_Yag_Domain_Model_Album $album
  */
 public function add($album)
 {
     if (!$album->getSorting()) {
         $sorting = 0;
         if ($album->getGallery()->getAlbums()->count() > 0) {
             $sorting = $album->getGallery()->getAlbums()->current()->getSorting();
         }
         $album->setSorting($sorting + 1);
     }
     parent::add($album);
 }
Exemplo n.º 2
0
 /**
  * Delete action for deleting an album
  *
  * @param Tx_Yag_Domain_Model_Album $album album that should be deleted
  * @return string	The rendered delete action
  * @rbacNeedsAccess
  * @rbacObject album
  * @rbacAction delete
  */
 public function deleteAction(Tx_Yag_Domain_Model_Album $album)
 {
     $gallery = $album->getGallery();
     $album->delete(TRUE);
     $this->addFlashMessage(LocalizationUtility::translate('tx_yag_controller_album.deletesuccessfull', $this->extensionName), '', FlashMessage::OK);
     $this->yagContext->setGallery($gallery);
     $this->redirect('index', 'Gallery');
 }