Example #1
0
 /**
  * Unpublish one or more entries
  *
  * @return     void
  */
 public function unpublishTask()
 {
     // Incoming
     $ids = Request::getVar('id', array());
     if (!is_array($ids)) {
         $ids = array();
     }
     // Make sure we have an ID
     if (empty($ids)) {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false));
         return;
     }
     // Instantiate an event object
     $event = new Event($this->database);
     // Loop through the IDs and unpublish the event
     foreach ($ids as $id) {
         $event->unpublish($id);
     }
     // Redirect
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_EVENTS_CAL_LANG_UNPUBLISHED'));
 }