/** * Remove one or more categories * * @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; } $jc = new JobCategory($this->database); foreach ($ids as $id) { // Delete the type $jc->delete($id); } // Redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_JOBS_ITEMS_REMOVED', count($ids))); }