/** * Insert contact */ function createComponentInsertForm() { $form = new \Nette\Forms\BootstrapPHForm(); $form->setTranslator($this->presenter->translator); $form->getElementPrototype()->class = "form-horizontal"; $form->getElementPrototype()->role = 'form'; $form->getElementPrototype()->autocomplete = 'off'; $form->addHidden("pages_id", $this->getParameter("id")); $form->addRadioList("type", "Osoba nebo organizace", array(0 => " osoby", 1 => " organizace")); $form->addText("title", "dictionary.main.Title")->setRequired($this->presenter->translator->translate('messages.pages.NameThePage')); $form->setDefaults(array("type" => 0)); $form->addSubmit("submitm", "dictionary.main.CreateNewContact")->setAttribute("class", "btn btn-success"); $form->onSuccess[] = $this->insertFormSucceeded; return $form; }
/** * Send request */ function createComponentSignForm() { $form = new \Nette\Forms\BootstrapPHForm(); $form->setTranslator($this->presenter->translator); $form->getElementPrototype()->class = "form-horizontal"; $form->getElementPrototype()->role = 'form'; $form->getElementPrototype()->autocomplete = 'off'; $form->getElementPrototype()->class = "contact-form"; $form->addHidden("event"); $form->addHidden("pages_id"); $form->addRadioList("selection"); $form->addText("name")->setAttribute("placeholder", "messages.helpdesk.name"); $form->addText("email")->setAttribute("placeholder", "messages.helpdesk.email"); $form->addText("phone")->setAttribute("placeholder", "dictionary.main.Phone"); $form->addTextArea("message")->setAttribute("class", "form-control"); $form->setDefaults(array("page_id" => $this->presenter->getParameter("id"), "event" => $this->presenter->getParameter("event"))); $form->addSubmit("submitm", "dictionary.main.Insert")->setAttribute("class", "btn btn-success"); $form->onValidate[] = $this->signFormValidated; $form->onSuccess[] = $this->signFormSucceeded; return $form; }