Example #1
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // action to execute
     $action = \SpoonFilter::getGetValue('action', array('deleteImages', 'deleteFiles', 'deleteVideos'), 'delete');
     if (!isset($_GET['id'])) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=no-selection');
     } else {
         // at least one id
         // redefine id's
         $aIds = (array) $_GET['id'];
         $slideshowID = (int) $_GET['product_id'];
         // delete media
         if ($action == 'deleteImages') {
             BackendCatalogModel::deleteImage($aIds);
         } elseif ($action == 'deleteFiles') {
             BackendCatalogModel::deleteFile($aIds);
         } elseif ($action == 'deleteVideos') {
             BackendCatalogModel::deleteVideo($aIds);
         }
     }
     $this->redirect(BackendModel::createURLForAction('media') . '&product_id=' . $slideshowID . '&report=deleted');
 }