/** * Edit page content */ function createComponentEditSnippetForm() { $form = new \Nette\Forms\BootstrapPHForm(); $form->setTranslator($this->presenter->translator); $form->getElementPrototype()->class = "form-horizontal"; $form->getElementPrototype()->role = 'form'; $form->getElementPrototype()->autocomplete = 'off'; $l = $this->presenter->getParameter("l"); $snippet = $this->database->table("snippets")->get($this->presenter->getParameter("snippet")); $form->addHidden("page_id"); $form->addHidden("snippet_id"); $form->addHidden("pages_id"); $form->addHidden("l"); $form->addTextArea("content")->setAttribute("class", "form-control")->setAttribute("height", "250px")->setHtmlId('wysiwyg-sm'); if ($l == '') { $arr["content"] = $snippet->content; } else { $arr["content"] = $snippet->{'content_' . $l}; $arr["l"] = $this->presenter->getParameter("l"); } $arr["page_id"] = $this->presenter->getParameter("id"); $arr["snippet_id"] = $this->presenter->getParameter("snippet"); $form->setDefaults($arr); $form->onSuccess[] = $this->editSnippetFormSucceeded; $form->addSubmit("submitm", "dictionary.main.Save")->setAttribute("class", "btn btn-success")->setHtmlId('formxins'); return $form; }
/** * Page settings */ function createComponentSetForm() { $pages = $this->database->table("pages")->get($this->presenter->getParameter("id")); $form = new \Nette\Forms\BootstrapPHForm(); $form->setTranslator($this->presenter->translator); $form->getElementPrototype()->class = "form-horizontal"; $form->getElementPrototype()->role = 'form'; $form->getElementPrototype()->autocomplete = 'off'; $l = $this->presenter->getParameter("l"); $form->addHidden("id"); $form->addHidden("l"); $form->addHidden("slug_old"); $form->addGroup(""); $form->addCheckbox("public", "dictionary.main.PublishedForm"); $form->addText("date_published", "Datum zveřejnění")->setAttribute("class", "datetimepicker"); $form->addText("title", "dictionary.main.Title"); $form->addText("slug", "dictionary.main.Slug"); $form->addGroup("dictionary.main.MetaTags"); $form->addTextArea("metadesc", "dictionary.main.MetaDesc")->setAttribute("class", "form-control"); $form->addTextArea("metakeys", "dictionary.main.MetaKeys")->setAttribute("class", "form-control"); if ($l == '') { $form->setDefaults(array("id" => $pages->id, "slug" => $pages->slug, "slug_old" => $pages->slug, "metadesc" => $pages->metadesc, "metakeys" => $pages->metakeys, "title" => $pages->title, "public" => $pages->public, "date_published" => $pages->date_published)); } else { $form->setDefaults(array("id" => $pages->id, "l" => $l, "slug" => $pages->{'slug_' . $l}, "slug_old" => $pages->{'slug_' . $l}, "metadesc" => $pages->{'metadesc_' . $l}, "metakeys" => $pages->{'metakeys_' . $l}, "title" => $pages->{'title_' . $l}, "public" => $pages->public, "date_published" => $pages->date_published)); } $form->onSuccess[] = $this->setFormSucceeded; $form->onValidate[] = $this->permissionValidated; $form->addSubmit("submit", "dictionary.main.Save")->setHtmlId('formxins'); return $form; }
/** * Insert contact */ function createComponentInsertForm() { $memberTable = $this->database->table("users")->get($this->presenter->getParameter("id")); $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("user"); $form->addHidden("page"); $form->addSubmit("submitm", "dictionary.main.Create")->setAttribute("class", "btn btn-success"); $form->setDefaults(array("page" => $this->presenter->getParameter("id"), "user" => $memberTable->id)); $form->onSuccess[] = $this->insertFormSucceeded; $form->onValidate[] = $this->insertFormValidated; return $form; }
protected function createComponentSearchForm() { $form = new \Nette\Forms\BootstrapPHForm(); $form->setTranslator($this->presenter->translator); $form->getElementPrototype()->class = "form-horizontal"; $form->getElementPrototype()->role = 'form'; $form->getElementPrototype()->autocomplete = 'off'; $form->setMethod("GET"); $form->addHidden('idr'); $form->addHidden('src'); $form->addHidden("priceFrom"); $form->addHidden("priceTo"); $form->addHidden("brand"); $form->setDefaults(array("idr" => $this->presenter->getParameter("id"), "src" => $this->presenter->getParameter("src"), "priceFrom" => $this->presenter->getParameter("priceFrom"), "PriceTo" => $this->presenter->getParameter("priceTo"), "brand" => $this->presenter->getParameter("brand"))); $form->addSubmit('submitm', 'dictionary.main.Save')->setAttribute("class", "btn btn-info btn-lg"); $form->onSuccess[] = $this->searchFormSucceeded; 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; }
/** * 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; }
/** * Filter */ protected function createComponentSearchTopForm() { $form = new \Nette\Forms\BootstrapPHForm(); $form->setMethod("GET"); $form->getElementPrototype()->class = "form-inline"; $form->addHidden('idr'); $form->addText('src')->setAttribute("class", "form-control")->setAttribute("placeholder", "Hledat"); $form->addText("priceFrom")->setAttribute("style", "width: 50px;"); $form->addText("priceTo")->setAttribute("style", "width: 50px;"); $form->addText("brand"); if ($this->getParameter("id")) { $form->setDefaults(array("idr" => $this->getParameter("id"))); } $form->addSubmit('submitm', 'dictionary.main.Search')->setAttribute("class", "btn btn-info btn-lg")->setAttribute("placeholder", "dictionary.main.Search"); $form->onSuccess[] = $this->searchTopFormSucceeded; return $form; }
protected function createComponentSearchForm() { $form = new \Nette\Forms\BootstrapPHForm(); $form->setTranslator($this->presenter->translator->domain('dictionary.main')); $form->setMethod("GET"); $form->getElementPrototype()->class = "form-inline"; $form->getElementPrototype()->role = 'form'; $form->getElementPrototype()->autocomplete = 'off'; $form->addHidden('idr', 'ID:'); $form->addText('src')->setAttribute("class", "form-control")->setAttribute("placeholder", \Nette\Utils\Strings::firstUpper("src")); $form->addText("priceFrom")->setAttribute("style", "width: 50px;"); $form->addText("priceTo")->setAttribute("style", "width: 50px;"); $form->addText("brand"); if ($this->getParameter("id")) { $form->setDefaults(array("idr" => $this->presenter->getParameter("id"))); } $form->addSubmit('submitm', 'dictionary.main.Search')->setAttribute("class", "btn btn-info btn-lg"); $form->onSuccess[] = $this->searchFormSucceeded; return $form; }