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 {
         // redefine id's
         $aIds = (array) $_GET['id'];
         $agendaID = (int) $_GET['agenda_id'];
         // delete media
         if ($action == 'deleteImages') {
             BackendAgendaModel::deleteImage($aIds);
         } else {
             if ($action == 'deleteFiles') {
                 BackendAgendaModel::deleteFile($aIds);
             } else {
                 if ($action == 'deleteVideos') {
                     BackendAgendaModel::deleteVideo($aIds);
                 }
             }
         }
     }
     $this->redirect(BackendModel::createURLForAction('media') . '&agenda_id=' . $agendaID . '&report=deleted');
 }