/** * * @param \Nette\Application\UI\Form $form */ public function serverPropsFormSubmitted(Form $form) { if ($this->allowedToEdit) { $content = $form->getValues()->props; $data = $this->fileModel->checkUnchangeableLines($content, $this->unchangeableLines); $this->fileModel->write($data, $this->filePath); $this->getPresenter()->flashMessage('Nastavení aktualizováno.', 'success'); } else { $this->flashMessage('Nemáte právo editovat nastavení.', 'error'); } if ($this->getPresenter()->isAjax()) { $this->getPresenter()->redrawControl(); } else { $this->getPresenter()->redirect('this'); } }