/** * Processes the Guestbook form * * @param \Nette\Application\Ui\Form $form Form to be processed */ public function guestBookFormSucceeded(\Nette\Application\Ui\Form $form) { $values = $form->getValues(TRUE); unset($values['send']); unset($values['spam']); unset($values['form_created']); if ($this->user->isLoggedIn()) { $values['user_id'] = $this->user->id; } $values['time'] = new \Nette\Utils\DateTime(); $this->guestbook->insert($values); $this->flashMessage('Zpráva byla odeslána'); $this->redirect('this'); }