Пример #1
0
 function setFormSucceeded(\Nette\Forms\BootstrapPHForm $form)
 {
     $doc = new \App\Model\Document($this->database);
     $doc->setLanguage($form->values->l);
     $doc->setPublic($form->values->public);
     $doc->setDatePublished($form->values->date_published);
     $doc->setTitle($form->values->title);
     $doc->setSlug($form->values->slug_old, $form->values->slug);
     $doc->setMetaKey($form->values->metakeys);
     $doc->setMetaDescription($form->values->metadesc);
     $doc->save($form->values->id, $this->presenter->user->getId());
     $this->presenter->redirect(this, array("id" => $form->values->id, "l" => $form->values->l));
 }
Пример #2
0
 function editFormSucceeded(\Nette\Forms\BootstrapPHForm $form)
 {
     $values = $form->getHttpData($form::DATA_TEXT);
     // get value from html input
     $doc = new \App\Model\Document($this->database);
     $doc->setLanguage($form->values->l);
     //$document = $this->purify($form->values->document);
     $doc->setDocument($form->values->document);
     $doc->setLanguage($form->values->l);
     $doc->setDatePublished($form->values->date_published);
     $doc->setTitle($form->values->title);
     $doc->setSlug($form->values->slug_old, $form->values->slug);
     $doc->setMetaKey($form->values->metakeys);
     $doc->setMetaDescription($form->values->metadesc);
     $doc->setParent($values["parent"]);
     $doc->save($form->values->id, $this->presenter->user->getId());
     $this->presenter->redirect(this, array("id" => $form->values->id, "l" => $form->values->l));
 }