示例#1
0
 /**
  * Remove type
  *
  * @return     void
  */
 public function removeTask()
 {
     // Check for request forgeries
     Request::checkToken();
     // Incoming (expecting an array)
     $ids = Request::getVar('id', array());
     $ids = !is_array($ids) ? array($ids) : $ids;
     // Ensure we have an ID to work with
     if (empty($ids)) {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_JOBS_ERROR_NO_ITEM_SELECTED'), 'error');
         return;
     }
     $jt = new JobType($this->database);
     foreach ($ids as $id) {
         // Delete the type
         $jt->delete(intval($id));
     }
     // Redirect
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_JOBS_ITEMS_REMOVED', count($ids)));
 }