protected function createComponentSimpleGoogleMapsForm() { $form = new \CustomForm(); $url_save = $this->oParentPresenter->link('ModuleSimpleGoogleMaps:Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('id'))); $form->setAction($url_save); $form->addText('address', 'Změnit adresu: ', 255)->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat adresu.'); $form->addSubmit('create', 'Uložit'); $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE); $form->setCustomRenderer(); return $form; }
protected function createComponentAddImagesForm() { $form = new \CustomForm(); $url_save = $this->link('Module' . $this->moduleName . ':SaveImages', array('moduleid' => $this->module->id, 'id' => $this->params['id'])); $form->setAction($url_save); $form->addUpload('img', 'Přidat obrázek:', true)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.')->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat image.'); $form->addSubmit('create', 'Nahrát'); $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE); $form->setCustomRenderer(); return $form; }
protected function createComponentEditForm() { $form = new \CustomForm(); $form->addRadioList('icon', 'Ikonka', $this->icons); $form->addTextArea('text', 'Text'); $form->addText('link', 'Odkaz (celá URL adresa)', 1000); $form->addSubmit('create', 'Uložit'); $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE); $form->setCustomRenderer(); $form->onSuccess[] = array($this, 'editFormSucceeded'); return $form; }
protected function createComponentEditForm() { $form = new \CustomForm(); $form->addUpload('img', 'Obrázek:')->addCondition(\Nette\Application\UI\Form::FILLED)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.'); $form->addText('title', 'Nadpis', 50, 255); $form->addText('subtitle', 'Podtitulek', 50, 255); $form->addTextArea('text', 'Text'); $form->addText('link', 'Odkaz (celá URL adresa)', 50); $form->addText('link_text', 'Viditelný text odkazu', 50, 32); $form->addSubmit('create', 'Uložit'); $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE); $form->setCustomRenderer(); $form->onSuccess[] = array($this, 'editFormSucceeded'); return $form; }
protected function createComponentBuyForm() { $form = new \CustomForm(); $form->addText("name", "Vaše jméno")->addRule(\Nette\Application\UI\Form::FILLED, 'Zadejte prosím vaše jméno.'); $form->addText("surname", "Vaše přijmení")->addRule(\Nette\Application\UI\Form::FILLED, 'Zadejte prosím vaše přijmení.'); $form->addText("email", "Váš email")->addRule(\Nette\Application\UI\Form::FILLED, 'Zadejte prosím váš e-mail.'); $form->addText("city", "Město")->addRule(\Nette\Application\UI\Form::FILLED, 'Zadejte prosím město.'); $form->addText("street", "Ulice a číslo popisné")->addRule(\Nette\Application\UI\Form::FILLED, 'Zadejte prosím ulici a číslo popisné.'); $form->addText("zip_code", "PSČ")->addRule(\Nette\Application\UI\Form::FILLED, 'Zadejte prosím PSČ.'); $form->addSubmit('addPage', 'Zakoupit'); $form->addSubmit('close', 'Zavřít')->setAttribute('data-dismiss', 'modal'); $form->onSuccess[] = array($this, 'buyFormSucceeded'); $form->setCustomRenderer(); return $form; }
protected function createComponentSettings() { $form = new \CustomForm(); $form->addUpload('logo', 'Logo')->addCondition(\Nette\Application\UI\Form::FILLED)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.'); $form->addText('title', 'Titulek stránky', 64); $form->addText('description', 'Popis stránky', 256); $form->addText('keywords', 'Klíčová slova stránky', 512); $form->addText('email', 'Hlavní e-mail', 512); $form->addHidden("layout"); $form->addText('layoutVisible', 'Layout')->setDisabled()->setValue($this->settings["layout"]->getTitle()); $form->addSubmit('setLayout', 'Vybrat jiný layout')->setAttribute("data-toggle", "modal")->setAttribute("data-target", "#layoutWizard")->setAttribute("type", "button"); $form->addSubmit('addPage', 'Uložit'); $defaults = $this->settings; $defaults["layout"] = $this->settings["layout"]->getName(); $form->setDefaults($defaults); $form->onSuccess[] = array($this, 'addPageModuleToPageFormSucceeded'); $form->setCustomRenderer(); return $form; }
protected function createComponentNewsletterForm() { $form = new \CustomForm(); $url_save = $this->oParentPresenter->link('ModuleEmailGatherer:Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('id'))); $form->setAction($url_save); $form->addText('email', 'Email: ', 256)->addRule(Form::EMAIL, 'Nezadali jste platnou e-mailovou adresu.')->setRequired('Zadejte e-mailovou adresu'); $form->addSubmit('create', 'Přihlásit se k odběru novinek!'); $form->setCustomRenderer(); return $form; }
/** * Sign-in form factory. * @return Nette\Application\UI\Form */ protected function createComponentSignInForm() { $form = new \CustomForm(); $form->addText('username', 'Přihlašovací jméno:')->setRequired('Prosím zadejte přihlašovací jméno.')->setAttribute("placeholder", "Přihlašovací jméno"); $form->addPassword('password', 'Heslo:')->setRequired('Prosím zadejte heslo.')->setAttribute("placeholder", "Heslo"); $form->addCheckbox('remember', 'Zapamatovat přihlášení na delší dobu.'); $form->addSubmit('send', 'Přihlásit'); // call method signInFormSucceeded() on success $form->onSuccess[] = $this->signInFormSucceeded; $form->setCustomRenderer(); return $form; }
protected function createComponentEditForm() { $form = new \CustomForm(); $form->addUpload('img', 'Obrázek:')->addCondition(\Nette\Application\UI\Form::FILLED)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.'); $form->addText('title', 'Nadpis', 50)->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat nadpis.'); $form->addText('subtitle', 'Podtitulek', 50); $form->addTextArea('text', 'Text')->setAttribute("class", "tinymce_text_editor")->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat text.'); $form->addText('client', 'Zákazník (jméno, město, ...)', 50); $form->addText('link', 'Odkaz (celá URL adresa)', 50); $form->addSubmit('create', 'Uložit'); $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE); $form->setCustomRenderer(); $form->onSuccess[] = array($this, 'editFormSucceeded'); return $form; }
protected function createComponentImageGaleryForm() { $form = new \CustomForm(); $url_save = $this->oParentPresenter->link('ModuleImageGalery:Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('id'))); $form->setAction($url_save); $form->addUpload('img', 'Obrázek:', true)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.')->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat image.'); $form->addText('description', 'Popis: ', 50); $form->addSubmit('create', 'Nahrát'); $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE); $form->setCustomRenderer(); return $form; }
protected function createComponentSettingsForm() { $form = new \CustomForm(); $url_save = $this->oParentPresenter->link("Module" . $this->moduleName . ":SaveSettings", array('id' => $this->module->id, 'parent_page_id' => $this->module->page_id)); $form->setAction($url_save); foreach ($this->module->settings as $setting) { $form->addText($setting->key, $setting->name)->setDefaultValue($setting->value); } $form->addSubmit('create', 'Uložit'); $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE); $form->setCustomRenderer(); return $form; }
/** createComponentEditPageForm GET VALUES FROM renderEdit, by line "$this['editPageForm']->setDefaults($this->page);" */ protected function createComponentEditPageForm() { $aPages = $this->context->page->getParentsForSelect(); // disable form submit when the page is homepage/index page of the web, // we dont want user to edit these homepage data $disabled = false; if ($this->page) { if ($this->page->id === 0) { $disabled = true; } } $form = new \CustomForm(); $form->addText('name', 'Jméno stránky:')->setRequired('Zadejte prosím jméno stránky.'); $form->addText('title', 'Titulek stránky:'); $form->addText('seo_url_text', 'SEO URL text:'); $form->addSelect('id_parent', 'Nadřazená stránka:', $aPages)->setPrompt('Zvolte nadřazenou stránku'); $form->addCheckbox('online', 'Zobrazovat stránku?'); $form->addSubmit('editPage', 'Editovat a uložit')->setDisabled($disabled); $form->onSuccess[] = array($this, 'editPageFormSucceeded'); $form->setCustomRenderer(); return $form; }