/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('genre', 'Název žánru: ')->setRequired('Musíte vyplnit název žánru')->addRule(Form::IS_NOT_IN, 'Tento žánr již existuje', $this->genresManager->getAllGenreNames())->getControlPrototype()->addAttributes(['tabindex' => 1, 'accesskey' => 'i']); $form->addSubmit('send', 'Vytvořit nový žánr')->getControlPrototype()->addAttributes(['tabindex' => 2, 'accesskey' => 's']); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $galleries = $this->galleriesRepository->getAll()->fetchPairs('id', 'name'); $themes = $this->articlesRepository->getAllThemes(); $form->addHidden('id', 'ID'); $form->addText('name', 'Název')->setAttribute('placeholder', 'Název článku')->setAttribute('class', 'form-control input-sm')->setRequired('Zadejte prosím Název článku'); $form->addText('url', 'URL')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'URL stránky'); $form->addCheckbox('active', 'Aktivní')->setAttribute('class', 'bootstrap'); $form->addText('title', 'Titulek')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Titulek v prohlížeči'); $form->addText('description', 'Description')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Popisek'); $form->addText('keywords', 'Keywords')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Klíčová slova'); $form->addTextArea('text', 'Text')->setAttribute('placeholder', 'Text stránky'); $form->addTextArea('secretText', 'Text po přihlášení')->setAttribute('placeholder', 'Text pro přihlášené uživatele'); $form->addText('pictureName', 'Obrázek')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Připojený obrázek')->setAttribute('onclick', 'openKCFinder(this)'); $form->addText('pictureDescription', 'Popisek obrázku')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Popisek obrázku'); $form->addMultiSelect('galleryIds', 'Svázané galerie', $galleries)->setAttribute('class', 'form-control input-sm select2')->setAttribute('placeholder', 'Galerie'); $form->addSelect('idTheme', 'Téma článku', $themes)->setAttribute('class', 'form-control input-sm select2')->setAttribute('placeholder', 'Téma článku'); $form->addText('theme', 'Nové téma')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Nové téma'); $form->addSubmit('save', 'Uložit')->setAttribute('class', 'btn btn-primary'); $form->addSubmit('saveandstay', 'Uložit a zůstat')->setAttribute('class', 'btn btn-default'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = function (Form $form) { $this->formSubmitted($form); }; return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $galleries = $this->galleriesRepository->getAll()->fetchPairs('id', 'name'); $form->addHidden('parent'); $form->addText('name', 'Název')->setAttribute('placeholder', 'Název stránky')->setAttribute('class', 'form-control input-sm')->setRequired('Zadejte prosím Název'); $form->addText('url', 'URL')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'URL stránky'); $form->addCheckbox('onHomepage', 'Na úvodní stranu')->setAttribute('class', 'bootstrap'); $form->addCheckboxList('inMenu', 'Položka menu:', ['topMenu' => 'Horní menu', 'footerMenu' => 'Menu v patičce', 'sideMenu' => 'Postranní menu', 'otherMenu' => 'Jiné menu'])->setAttribute('class', 'bootstrap'); $form->addCheckbox('active', 'Aktivní')->setAttribute('class', 'bootstrap'); $form->addCheckbox('secret', 'Pro přihlášené')->setAttribute('class', 'bootstrap'); $form->addText('menuTitle', 'Název do menu')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Název v menu'); $form->addText('title', 'Titulek')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Titulek v prohlížeči'); $form->addText('description', 'Description')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Popisek'); $form->addText('keywords', 'Keywords')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Klíčová slova'); $form->addTextArea('perex', 'Perex')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Perex'); $form->addTextArea('text', 'Text')->setAttribute('placeholder', 'Text stránky'); $form->addTextArea('secretText', 'Text po přihlášení')->setAttribute('placeholder', 'Text pro přihlášené uživatele'); $form->addText('pictureName', 'Obrázek')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Připojený obrázek')->setAttribute('onclick', 'openKCFinder(this)'); $form->addText('pictureDescription', 'Popisek obrázku')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Popisek obrázku'); $form->addMultiSelect('galleryIds', 'Svázané galerie', $galleries)->setAttribute('class', 'form-control input-sm select2')->setAttribute('placeholder', 'Galerie'); $form->addSubmit('save', 'Uložit')->setAttribute('class', 'btn btn-primary'); $form->addSubmit('saveandstay', 'Uložit a zůstat')->setAttribute('class', 'btn btn-default'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = function (Form $form) { $this->formSubmitted($form); }; return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('text', '')->setRequired('Musíte zadat hledaný pojem'); $form->addSubmit('search', ''); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('email', 'Váš email')->addCondition(Form::FILLED)->addRule(Form::EMAIL, 'Vložte validní email'); $form->addText('username', 'Uživatelské jméno')->addConditionOn($form['email'], ~Form::FILLED, TRUE)->addRule(Form::FILLED, 'Vložte buď email, nebo uživatelské jméno'); $form->addSubmit('send', 'Odeslat'); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('username', 'Username:'******'Please enter your username.'); $form->addPassword('password', 'Password:'******'Please enter your password.'); $form->addCheckbox('remember', 'Keep me signed in'); $form->addSubmit('send', 'Sign in'); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addHidden('username'); $form->addHidden('passwordHash'); $form->addHidden('passwordHashValidity'); $form->addPassword('password', 'Nové heslo')->setRequired('Vyplňte své nové heslo'); $form->addSubmit('send', 'Odeslat'); return $form; }
/** * @return UI\Form */ protected function createComponentSearchForm() { $form = $this->factory->create(); $form->addText('term', 'hledat')->setRequired("Zadejte hledaný termín")->setAttribute('class', 'form-control input-sm'); $form->addButton('process', "Hledat")->setAttribute('onclick', 'this.form.submit();')->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = callback($this, 'processForm'); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('username', 'Jméno:')->setRequired('Zadejte své uživatelské jméno.'); $form->addPassword('password', 'Heslo:')->setRequired('Zadejte své heslo.'); $form->addCheckbox('remember', 'Zůstat přihlášen'); $form->addSubmit('send', 'Přihlásit se'); $form->onSuccess[] = $this->formSucceeded; return $form; }
public function createComponentForm() { $form = $this->factory->create(); $form->addText('username', 'Steel?')->setRequired('Steel steel steel steel Steel:'); $form->addPassword('password', 'Steel?#|@')->setRequired('Steel steel.'); $form->addCheckbox('remember', 'Steeeeeeeeeeeel'); $form->addSubmit('send', 'Steel'); $form->onSuccess[] = $this->processForm; return $form; }
public function createComponentForm() { $form = $this->factory->create(); $form->addText('title', 'Název')->setMaxLength(420)->setRequired(); $form->addText('count', 'Počet')->setDefaultValue(1); $form->addUpload('picture', 'Foto'); $form->addSubmit('save', 'Vložit'); $form->onSuccess[] = $this->processForm; return $form; }
/** * @param string $defaultGenre * @return Form */ public function create(string $defaultGenre = null) { $form = $this->factory->create(); $maxSize = SizeParser::parse_size(ini_get("upload_max_filesize")); $form->addUpload('song', 'Nová skladba: ', true)->addRule(Form::MAX_FILE_SIZE, 'Nemůžete nahrát vetší soubor než ' . Filters::bytes($maxSize) . '(nastaveno v php.ini)', $maxSize)->getControlPrototype()->addAttributes(['class' => 'file', 'tabindex' => 1, 'accesskey' => 'i']); $genres = $this->genresManager->getAllGenreIdsAndNames(); $form->addSelect('genre', 'Žánr: ', $genres)->setPrompt('-')->setDefaultValue($defaultGenre)->getControlPrototype()->addAttributes(['tabindex' => 2, 'accesskey' => 'g']); $form->addSubmit('send', 'Nahrát skladbu')->getControlPrototype()->addAttributes(['tabindex' => 3, 'accesskey' => 's']); $form->onValidate[] = $this->validateSongsMetadata; return $form; }
/** * @return UI\Form */ protected function createComponentAddCommentForm() { $form = $this->factory->create(); $form->addText('name', 'Vaše jméno')->setRequired("Vložte prosím vaše jméno")->setAttribute('class', 'form-control input-sm'); $form->addTextArea('text', "Text komentáře")->setRequired("Vložte prosím text komentáře")->setAttribute('class', 'form-control input-sm'); $form->addSubmit('process', "Odeslat ke schválení")->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal ajax'); $form->onSuccess[] = callback($this, 'processForm'); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('username', 'Username')->setRequired('Zadejte své username'); $form->addPassword('password', "Heslo")->setRequired("Zadejte heslo"); $form->addText('email', "email")->setRequired("Zadejte svůj email"); $form->addText('name', "Jméno")->setRequired("Zadejte své křestní jméno"); $form->addText('lastname', "Příjmení")->setRequired("Zadejte své příjmení"); $form->addHidden('role', 'registered'); $form->addSubmit('send', "Registrovat"); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addHidden('id', 'ID'); $form->addTextArea('text', 'Obsah patičky')->setAttribute('placeholder', 'Obsah patičky')->setAttribute('class', 'form-control input-sm'); $form->addSubmit('process', 'Odeslat')->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = function (Form $form) { $this->formSucceeded($form); }; return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('name', 'Název')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Název'); $form->addText('description', 'Popis')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Popis'); $form->addSubmit('save', 'Odeslat')->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = function (Form $form) { $this->formSucceeded($form); }; return $form; }
/** * @return UI\Form */ public function createComponentContactForm() { $form = $this->factory->create(); $form->addText('name', 'Vaše jméno:')->addRule(UI\Form::FILLED, 'Zadejte jméno')->setAttribute('class', 'form-control input-sm'); $form->addText('email', 'Vaše e-mailová adresa:')->addRule(UI\Form::EMAIL, 'Email nemá správný formát')->setAttribute('class', 'form-control input-sm'); $form->addText('subject', 'Předmět:')->addRule(UI\Form::FILLED, 'Zadejte předmět')->setAttribute('class', 'form-control input-sm'); $form->addTextArea('message', 'Zpráva:')->addRule(UI\Form::FILLED, 'Zadejte zprávu')->setAttribute('class', 'form-control input-sm'); $form->addSubmit('process', 'Odeslat')->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = callback($this, 'processForm'); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('imgName', 'Obrázek')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Obrázek')->setAttribute('onclick', 'openKCFinder(this)'); $form->addText('imgTitle', 'Titulek obrázku')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Titulek obrázku'); $form->addTextArea('imgDescription', 'Popisek obrázku')->setAttribute('class', 'form-control input-sm')->setAttribute('placeholder', 'Popisek obrázku'); $form->addSubmit('save', 'Uložit')->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = function (Form $form) { $this->formSucceeded($form); }; return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $roles = ['guest' => "Host", 'user' => "Uživatel", 'admin' => "Administrátor"]; $form->addText('username', "Login")->setAttribute('placeholder', "Login")->setAttribute('class', 'form-control input-sm')->setRequired("Vyplňte prosím Login"); $form->addPassword('password', 'Heslo')->setAttribute('placeholder', "Heslo")->setAttribute('class', 'form-control input-sm'); $form->addPassword('password2', 'Heslo pro kontrolu')->addRule(Form::EQUAL, "Vyplňte heslo pro kontrolu", $form['password'])->setAttribute('placeholder', " pro kontrolu")->setAttribute('class', 'form-control input-sm'); $form->addText('name', "Jméno")->setAttribute('placeholder', "Jméno")->setAttribute('class', 'form-control input-sm'); $form->addText('lastname', "Příjmení")->setAttribute('placeholder', "Příjmení")->setAttribute('class', 'form-control input-sm'); $form->addText('email', "email")->setType('email')->addRule(Form::EMAIL, "Vyplňte email ve správném formátu")->setAttribute('placeholder', "Email")->setAttribute('class', 'form-control input-sm'); $form->addSelect('role', "Role" . ": ", $roles)->setAttribute('class', 'form-control input-sm'); $form->addSubmit('process', "Odeslat")->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addText('title', 'Titulek')->setAttribute('class', 'form-control input-sm'); $form->addText('url', 'URL')->setAttribute('class', 'form-control input-sm'); $form->addTextArea('text', 'Text novinky'); $form->addCheckbox('active', 'Aktivní')->setAttribute('class', 'bootstrap'); $form->addSubmit('save', 'Odeslat')->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = function (Form $form) { $this->formSucceeded($form); }; return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $roles = ['guest' => "Host", 'user' => "Uživatel", 'admin' => "Administrátor"]; $form->addHidden('id', 'ID'); $form->addText('username', "messages.users.login")->setAttribute('placeholder', "messages.users.loginPlaceholder")->setAttribute('class', 'form-control input-sm')->setRequired("messages.users.plsLogin"); $form->addPassword('password', '')->setAttribute('placeholder', "messages.users.passwordPlaceholder")->setAttribute('class', 'form-control input-sm'); $form->addPassword('password2', '')->addRule(Form::EQUAL, "messages.users.equalPassword", $form['password'])->setAttribute('placeholder', "messages.users.password2Placeholder")->setAttribute('class', 'form-control input-sm'); $form->addText('name', "messages.users.name")->setAttribute('placeholder', "messages.users.namePlaceholder")->setAttribute('class', 'form-control input-sm'); $form->addText('lastname', "messages.users.lastName")->setAttribute('placeholder', "messages.users.lastNamePlaceholder")->setAttribute('class', 'form-control input-sm'); $form->addText('email', "messages.users.email")->setType('email')->addRule(Form::EMAIL, "messages.users.validEmail")->setAttribute('placeholder', "messages.users.emailPlaceholder")->setAttribute('class', 'form-control input-sm'); $form->addSelect('role', "messages.users.validEmail" . ": ", $roles)->setAttribute('class', 'form-control input-sm'); $form->addSubmit('process', "messages.users.btnSubmit")->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $form->addHidden('id', 'ID'); $form->addText('author', 'Autor')->setAttribute('class', 'form-control input-sm'); $form->addTextArea('text', 'Text novinky'); $form->addCheckbox('allowed', 'Schváleno')->setAttribute('class', 'bootstrap'); $form->addText('date', 'Datum vložení')->setAttribute('class', 'form-control input-sm'); $form->addText('pageName', 'Ke stránce')->setAttribute('class', 'form-control input-sm'); $form->addText('articleName', 'K článku')->setAttribute('class', 'form-control input-sm'); $form->addSubmit('save', 'Odeslat')->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->getElementPrototype()->class('form-horizontal'); $form->onSuccess[] = function (Form $form) { $this->formSucceeded($form); }; return $form; }
/** * @return Form */ public function create(callable $onSuccess) { $form = $this->factory->create(); $form->addText('username', 'Pick a username:'******'Please pick a username.'); $form->addEmail('email', 'Your e-mail:')->setRequired('Please enter your e-mail.'); $form->addPassword('password', 'Create a password:'******'description', sprintf('at least %d characters', self::PASSWORD_MIN_LENGTH))->setRequired('Please create a password.')->addRule($form::MIN_LENGTH, NULL, self::PASSWORD_MIN_LENGTH); $form->addSubmit('send', 'Sign up'); $form->onSuccess[] = function (Form $form, $values) use($onSuccess) { try { $this->userManager->add($values->username, $values->email, $values->password); } catch (Model\DuplicateNameException $e) { $form['username']->addError('Username is already taken.'); return; } $onSuccess(); }; return $form; }
/** * @return Form */ public function create(callable $onSuccess) { $form = $this->factory->create(); $form->addText('username', 'Username:'******'Please enter your username.'); $form->addPassword('password', 'Password:'******'Please enter your password.'); $form->addCheckbox('remember', 'Keep me signed in'); $form->addSubmit('send', 'Sign in'); $form->onSuccess[] = function (Form $form, $values) use($onSuccess) { try { $this->user->setExpiration($values->remember ? '14 days' : '20 minutes'); $this->user->login($values->username, $values->password); } catch (Nette\Security\AuthenticationException $e) { $form->addError('The username or password you entered is incorrect.'); return; } $onSuccess(); }; return $form; }
/** * @return Form */ public function create() { $form = $this->factory->create(); $pages = $this->pagesRepository->getAll()->fetchPairs('id', 'name'); $themes = []; foreach (Finder::findDirectories('*')->in(__DIR__ . '/../../../themes') as $dir) { /** @var \SplFileInfo $dir */ $filename = $dir->getFilename(); $themes[$filename] = $filename; } $form->addText('siteName', "messages.settings.siteName")->setAttribute('placeholder', "messages.settings.siteName")->setAttribute('class', 'form-control input-sm')->setRequired("messages.settings.plsSiteName"); $form->addText('adminMail', "messages.settings.adminMail")->setAttribute('placeholder', "messages.settings.adminMail")->setAttribute('class', 'form-control input-sm')->setRequired("messages.settings.plsAdminMail"); $form->addText('companyMail', "messages.settings.companyMail")->setAttribute('placeholder', "messages.settings.companyMail")->setAttribute('class', 'form-control input-sm')->setRequired("messages.settings.plsCompanyMail"); $form->addText('companyPhone', "messages.settings.companyPhone")->setAttribute('placeholder', "messages.settings.companyPhone")->setAttribute('class', 'form-control input-sm')->setRequired("messages.settings.plsCompanyPhone"); $form->addText('companyAddress', "messages.settings.companyAddress")->setAttribute('placeholder', "messages.settings.companyAddress")->setAttribute('class', 'form-control input-sm')->setRequired("messages.settings.plsCompanyAddress"); $form->addText('noreplyMail', "messages.settings.noreplyMail")->setAttribute('placeholder', "messages.settings.noreplyMail")->setAttribute('class', 'form-control input-sm'); $form->addText('motto1', "messages.settings.motto1")->setAttribute('placeholder', "messages.settings.motto1")->setAttribute('class', 'form-control input-sm'); $form->addText('motto2', "messages.settings.motto2")->setAttribute('placeholder', "messages.settings.motto2")->setAttribute('class', 'form-control input-sm'); $form->addSelect('theme', "messages.settings.template", $themes)->setAttribute('class', 'form-control input-sm'); $form->addText('smtpHost', "messages.settings.smtpServer")->setAttribute('placeholder', "messages.settings.smtpServer")->setAttribute('class', 'form-control input-sm'); $form->addText('smtpUsername', "messages.settings.smtpUsername")->setAttribute('placeholder', "messages.settings.smtpUsername")->setAttribute('class', 'form-control input-sm'); $form->addText('smtpPassword', "messages.settings.smtpPassword")->setAttribute('placeholder', "messages.settings.smtpPassword")->setAttribute('class', 'form-control input-sm'); $form->addText('smtpSecure', "messages.settings.smtpSecure")->setAttribute('placeholder', "messages.settings.smtpSecure")->setAttribute('class', 'form-control input-sm'); $form->addCheckbox('useMail', "messages.settings.useMail")->setAttribute('placeholder', "messages.settings.useMail")->setAttribute('class', 'bootstrap'); $form->addTextArea('ownScript', "messages.settings.footerScript")->setAttribute('placeholder', "messages.settings.footerScript")->setAttribute('class', 'form-control input-sm')->setAttribute('rows', '20'); $form->addSelect('thanksPage', "messages.settings.thanksPage", $pages)->setAttribute('class', 'form-control input-sm select2'); $form->addCheckbox('showAsBlog', "messages.settings.showAsBlog")->setAttribute('class', 'bootstrap'); $form->addText('pagesPerPage', "messages.settings.pagesPerPage")->setAttribute('placeholder', "messages.settings.pagesPerPage")->setAttribute('class', 'form-control input-sm'); $form->addText('rowInRss', "messages.settings.rowInRss")->setAttribute('placeholder', "messages.settings.rowInRss")->setAttribute('class', 'form-control input-sm'); $form->addText('logo', "messages.settings.logo")->setAttribute('placeholder', "messages.settings.logo")->setAttribute('onclick', 'openKCFinder(this)')->setAttribute('class', 'form-control input-sm'); $form->addText('sliderInterval', "messages.settings.interval")->setAttribute('placeholder', "messages.settings.interval")->setAttribute('class', 'form-control input-sm'); $form->addSubmit('process', "messages.settings.btnSubmit")->setAttribute('class', 'btn btn-primary'); $form->setRenderer(new BootstrapRenderer()); $form->onSuccess[] = function (Form $form) { $this->formSucceeded($form); }; return $form; }