Example #1
0
 /**
  * Delete one or more records
  *
  * @return  void
  */
 public function removeTask()
 {
     // Check for request forgeries
     Request::checkToken();
     // Incoming
     $ids = Request::getVar('id', array(0));
     if (!is_array($ids)) {
         $ids = array(0);
     }
     // Check for an ID
     if (count($ids) < 1) {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_SUPPORT_ERROR_SELECT_CATEGORY_TO_DELETE'), 'error');
         return;
     }
     foreach ($ids as $id) {
         // Delete message
         $cat = new Category($this->database);
         $cat->delete(intval($id));
     }
     // Output messsage and redirect
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_SUPPORT_CATEGORY_SUCCESSFULLY_DELETED', count($ids)));
 }