예제 #1
0
 /**
  * process of add new item form
  * @param \Nette\Application\UI\Form $form
  */
 public function processAddForm(\Nette\Application\UI\Form $form)
 {
     if (!$this->user->isAllowed("config", "add")) {
         $this->flashMessage(_("You are not allowed to do this action."), "danger");
         $this->redirect("this");
     }
     $values = $form->getValues();
     try {
         $this->model->addItem($values);
         $this->flashMessage(_("New item added."), "success");
         $this->redirect("this");
     } catch (RemoteNodesException $exc) {
         $this->flashMessage($exc->getMessage(), "danger");
         $this->redirect("this");
     }
 }