/** * handle a process of deleting item * @param int $id */ public function handleDelete($id) { if (!$this->user->isAllowed("config", "delete")) { $this->flashMessage(_("You are not allowed to do this action."), "danger"); $this->redirect("this"); } try { $this->model->deleteItem($id); $this->flashMessage(_("Item was deleted."), "success"); $this->redirect("this"); } catch (RemoteNodesException $exc) { $this->flashMessage($exc->getMessage(), "danger"); $this->redirect("this"); } }