function insertFormSucceeded(\Nette\Forms\BootstrapPHForm $form)
 {
     $doc = new \App\Model\Document($this->database);
     $doc->setType(5);
     $doc->createSlug("contact-" . $form->values->user);
     $doc->setTitle($form->values->title);
     $page = $doc->create($this->presenter->user->getId());
     \App\Model\IO::directoryMake(substr(APP_DIR, 0, -4) . '/www/media/' . $page);
     $arr = array("pages_id" => $page, "type" => 1, "name" => 'contact-' . $form->values->user, "users_id" => $form->values->user);
     $this->database->table("contacts")->insert($arr);
     $this->presenter->redirect(this, array("id" => $form->values->page));
 }
 function addSucceeded(\Nette\Forms\BootstrapUIForm $form)
 {
     $doc = new \App\Model\Document($this->database);
     $doc->setType(5);
     $doc->createSlug("contact-" . $form->values->email);
     $doc->setTitle($form->values->email);
     $page = $doc->create($this->presenter->user->getId());
     \App\Model\IO::directoryMake(substr(APP_DIR, 0, -4) . '/www/media/' . $page, 0755);
     $arr = array("users_id" => null, "pages_id" => $page, "type" => 0);
     $arr["email"] = $form->values->email;
     $arr["name"] = $form->values->email;
     $this->database->table("contacts")->insert($arr);
     $this->presenter->flashMessage("Byli jste přihlášení k odeběru newsletteru");
     $this->presenter->redirect(this);
 }
Пример #3
0
 function insertFormSucceeded(\Nette\Forms\BootstrapPHForm $form)
 {
     $doc = new \App\Model\Document($this->database);
     $doc->setType(5);
     $doc->createSlug("contact-" . $form->values->title);
     $doc->setTitle($form->values->title);
     $page = $doc->create($this->template->user->getId());
     \App\Model\IO::directoryMake(substr(APP_DIR, 0, -4) . '/www/media/' . $page, 0755);
     $arr = array("users_id" => null, "pages_id" => $page, "type" => $form->values->type);
     if ($form->values->type == 0) {
         $arr["name"] = $form->values->title;
     } else {
         $arr["company"] = $form->values->title;
     }
     $this->database->table("contacts")->insert($arr);
     $this->presenter->redirect(":Admin:Contacts:detail", array("id" => $page));
 }