Пример #1
0
 /**
  * Delete one or more records
  *
  * @return  void
  */
 public function removeTask()
 {
     // Check for request forgeries
     Request::checkToken();
     // Incoming
     $ids = Request::getVar('id', array());
     $ids = !is_array($ids) ? array($ids) : $ids;
     // 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_MESSAGE_TO_DELETE'), 'error');
         return;
     }
     foreach ($ids as $id) {
         // Delete message
         $msg = new Message($this->database);
         $msg->delete(intval($id));
     }
     // Output messsage and redirect
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_SUPPORT_MESSAGE_SUCCESSFULLY_DELETED', count($ids)));
 }