/** * Delete one or more records * * @return void */ public function removeTask() { // Check for request forgeries Request::checkToken(); $ids = Request::getVar('id', array()); $i = 0; foreach ($ids as $id) { $row = new Aro($this->database); $row->load(intval($id)); if ($row->id) { $aro_aco = new AroAco($this->database); if (!$aro_aco->deleteRecordsByAro($row->id)) { Notify::error($aro_aco->getError()); continue; } } if (!$row->delete()) { Notify::error($row->getError()); continue; } $i++; } if ($i) { Notify::success(Lang::txt('COM_SUPPORT_ACL_REMOVED')); } // Output messsage and redirect $this->cancelTask(); }
/** * Delete one or more records * * @return void */ public function removeTask() { // Check for request forgeries Request::checkToken(); $ids = Request::getVar('id', array()); foreach ($ids as $id) { $row = new Aro($this->database); $row->load(intval($id)); if ($row->id) { $aro_aco = new AroAco($this->database); if (!$aro_aco->deleteRecordsByAro($row->id)) { throw new Exception($aro_aco->getError(), 500); } } if (!$row->delete()) { throw new Exception($row->getError(), 500); } } // Output messsage and redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_SUPPORT_ACL_REMOVED')); }