Exemple #1
0
 public function create()
 {
     $form = new Form();
     $form->getElementPrototype()->addClass('form-horizontal');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
Exemple #2
0
 /**
  * @return Form
  */
 public function create()
 {
     $form = new Form();
     $form->setTranslator($this->translator);
     $form->setRenderer(new \Nextras\Forms\Rendering\Bs3FormRenderer());
     return $form;
 }
 protected function getBootstrapForm()
 {
     $form = new Form();
     $renderer = new BT3Renderer();
     $form->setRenderer($renderer);
     return $form;
 }
 public function vytvorit()
 {
     $form = new Form();
     $form->addText('meno', '*Meno:')->setRequired();
     $form->addText('datumNarodenia', 'Dátum narodenia(YYYY-MM-DD):')->addCondition(Form::FILLED)->addRule(Form::PATTERN, 'Nesprávny fomrát', '([0-9]){4}-([0-9]){1,2}-([0-9]){1,2}');
     $form->addText('datumUmrtia', 'Dátum úmrtia(YYYY-MM-DD):')->addCondition(Form::FILLED)->addRule(Form::PATTERN, 'Nesprávny fomrát', '([0-9]){4}-([0-9]){1,2}-([0-9]){1,2}');
     $form->addText('trieda', 'Trieda:');
     $form->addText('rad', 'Rad:');
     $form->addText('celad', 'Čelaď:');
     $form->addText('rod', 'Rod:');
     //Ziskam vsetky druhy zivocicha aby som to mohol dat do pola a pouzivat na vyber v select boxe
     $hodnotyDruhu = array();
     $druhyZivocichov = $this->database->table('druhZivocicha');
     foreach ($druhyZivocichov as $druhZivocicha) {
         $hodnotyDruhu[$druhZivocicha->IDDruhuZivocicha] = $druhZivocicha->nazov;
     }
     $form->addSelect('IDDruhuZivocicha', '*Druh:', $hodnotyDruhu)->setRequired();
     //Ziskam vsetky umiestnenia aby som to mohol dat do pola a pouzivat na vyber v select boxe
     $hodnotyUmiestnenia = array();
     $umiestnenia = $this->database->table('umiestnenie');
     foreach ($umiestnenia as $umiestnenie) {
         $hodnotyUmiestnenia[$umiestnenie->IDUmiestnenia] = $umiestnenie->nazov;
     }
     $form->addSelect('IDUmiestnenia', '*Umiestnenie:', $hodnotyUmiestnenia)->setRequired();
     $form->addSubmit('editovat', 'Editovať');
     $form->onSuccess[] = array($this, 'uspesne');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
 /**
  * @return Form
  */
 public function create()
 {
     $form = new Form();
     $form->setTranslator($this->translator);
     $form->setRenderer(new BaseFormRenderer());
     return $form;
 }
Exemple #6
0
 protected function createComponentVytvoritForm()
 {
     $form = new Form();
     //Zivocich
     $hodnotyZivocich = array();
     $zivocichy = $this->database->table('zivocich');
     //ziskam si vsetkych zivocichov
     foreach ($zivocichy as $zivocich) {
         $hodnotyZivocich[$zivocich->IDZivocicha] = $zivocich->meno;
     }
     $form->addSelect('IDZivocicha', '*Živočích:', $hodnotyZivocich)->setRequired();
     //Zamestnanec
     $hodnotyZamestnancov = array();
     if ($this->getUser()->roles[0] == 'riaditeľ') {
         $zamestnanci = $this->database->table('zamestnanec');
         //ziskam si vsetkych zamestnancov
         foreach ($zamestnanci as $zamestnanec) {
             $hodnotyZamestnancov[$zamestnanec->RodneCislo] = $zamestnanec->meno . " " . $zamestnanec->priezvisko;
         }
     } else {
         $hodnotyZamestnancov[$this->getUser()->id] = $this->getUser()->getIdentity()->data['meno'];
     }
     $form->addSelect('RodneCislo', '*Zamestnanec:', $hodnotyZamestnancov)->setRequired();
     $form->addText('hmotnostZivocicha', 'Hmotnosť živočícha:')->addCondition(Form::FILLED)->addRule(Form::FLOAT, 'Pole musi obsahovať iba čísla!');
     $form->addText('rozmerZivocicha', 'Rozmer živočícha:')->addCondition(Form::FILLED)->addRule(Form::FLOAT, 'Pole musi obsahovať iba čísla!');
     $form->addText('datumTestu', '*Dátum testu(YYYY-MM-DD):')->setRequired()->addRule(Form::PATTERN, 'Nesprávny fomrát', '([0-9]){4}-([0-9]){2}-([0-9]){2}');
     $form->addSubmit('vytvorit', 'Vytvoriť');
     $form->onSuccess[] = array($this, 'uspesne');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
Exemple #7
0
 /**
  * @return \Nette\Application\UI\Form
  */
 public function create()
 {
     $form = new Form();
     $form->addGroup($this->user ? 'Upravit uživatele' : 'Přidat uživatele');
     $form->addText("name", 'Jméno:')->setRequired('Vyplňte jméno');
     $form->addText("email", 'Email:')->setRequired('Vyplňte email')->addRule(function ($ctrl) {
         if ($this->user and $this->user->email == $ctrl->getValue()) {
             return TRUE;
         }
         return (bool) (!$this->userFacade->findUserByEmail($ctrl->getValue()));
     }, 'Email je obsazen, zvolte prosím jiný');
     $password = $form->addPassword("password", 'Heslo:');
     $password2 = $form->addPassword("password2", 'Heslo znovu:');
     if (!$this->user) {
         $password->setRequired('Vyplňte heslo');
         $password2->addRule(Form::FILLED, 'Vyplňte heslo znovu pro kontrolu')->addRule(Form::EQUAL, 'Hesla se neshodují', $password);
     } else {
         $password2->addConditionOn($password, Form::FILLED)->setRequired('Vyplňte heslo znovu pro kontrolu')->addRule(Form::EQUAL, 'Hesla se neshodují', $password);
     }
     $form->addSubmit("send", $this->user ? 'Upravit uživatele' : 'Přidat uživatele');
     $form->setRenderer(new Bs3FormRenderer());
     $form->onSuccess[] = $this->processForm;
     if ($this->user) {
         $form->setDefaults(["name" => $this->user->name, "email" => $this->user->email]);
     }
     return $form;
 }
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->addText("email", "Email")->setRequired("Zadej prosím platnou emailovou adresu.")->addRule(Form::EMAIL, "Zadej prosím platnou emailovou adresu.")->setType("email");
     $form->addSubmit("submit", "Zažádat o změnu hesla")->setAttribute("class", "btn btn-primary btn-lg btn-block");
     return $form;
 }
 public static function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->addPassword("password", "Heslo")->setRequired("Zadejte prosím heslo, pomocí kterého se budete přihlašovat.")->addRule(Form::MIN_LENGTH, 'Heslo musí mít alespoň %d znaků', User::MIN_PASSWORD_LENGTH);
     $form->addPassword("passwordVerify", "Heslo znovu")->setRequired("Zadejte prosím stejné heslo ještě jednou.")->addRule(Form::EQUAL, "Zadaná hesla se musí shodovat", $form["password"]);
     $form->addSubmit("submit", "Vytvořit heslo")->setAttribute("class", "btn btn-primary btn-lg btn-block");
     return $form;
 }
Exemple #10
0
 public function vytvorit()
 {
     $form = new Form();
     $form->addText('nazov', '*Názov:')->setRequired();
     $form->addSubmit('vytvorit', 'Vytvoriť');
     $form->onSuccess[] = array($this, 'uspesne');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
Exemple #11
0
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapInlineRenderer());
     $form->addText("email", "Odeslat tuto statistiku na email:")->setRequired("Zadej prosím platnou emailovou adresu, na kterou chceš statistiky v tabulce odeslat.")->addRule(Form::EMAIL, "Zadej prosím platnou emailovou adresu, na kterou chceš statistiky v tabulce odeslat.")->setValue($this->emailOwner)->setAttribute("size", 35)->setType("email");
     $form->addSubmit("send", "Odeslat")->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->sendStatsFormSucceeded;
     return $form;
 }
Exemple #12
0
 public function createComponentRaceDeleteConfirm()
 {
     $form = new Form();
     $form->addSubmit('cancel', 'Zpět')->onClick[] = [$this, 'formCancelled'];
     $form->addSubmit('send', 'OK');
     $form->onSuccess[] = [$this, 'raceDeleteSucceeded'];
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
Exemple #13
0
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->addText("email", "Email")->setRequired("Zadej prosím platnou emailovou adresu.")->addRule(Form::EMAIL, "Zadej prosím platnou emailovou adresu.")->setType("email");
     $form->addPassword("password", "Heslo")->setRequired("Zadej prosím své přihlašovací heslo.");
     $form->addSubmit("submit", "Přihlásit se")->setAttribute("class", "btn btn-primary btn-lg btn-block");
     $form->onSuccess[] = array($this, "signInFormSucceeded");
     return $form;
 }
Exemple #14
0
 public function create($userId)
 {
     $this->getUser($userId);
     $form = new Form();
     $form->setRenderer(new BootstrapInlineRenderer());
     $form->addSelect("role")->setItems($this->roleFacade->findPrivacy(true), false)->setDefaultValue($this->user->role)->setAttribute("onchange", "submit()");
     $form->addHidden("userId", $this->user->id);
     $form->onSuccess[] = $this->changeRoleFormSucceeded;
     return $form;
 }
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapInlineRenderer());
     $form->addSelect("month")->setItems(DateTimeUtils::getMonths())->setDefaultValue(date("n"));
     $form->addSelect("year")->setItems(DateTimeUtils::getYears())->setDefaultValue(date("Y"));
     $form->addSubmit("send", "Vygenerovat")->setAttribute("class", "btn btn-default");
     $form->onSuccess[] = $this->generateStatsFormSucceeded;
     return $form;
 }
 protected function createComponentSignForm()
 {
     $form = new Form();
     $form->setRenderer(new Nette\Forms\Rendering\TB3FormRenderer());
     $form->addText('nick', 'Nick:');
     $form->addPassword('password', 'Heslo:');
     $form->addSubmit('login', 'Login')->setAttribute('class', 'btn btn-primary');
     $form->onSuccess[] = [$this, 'signFormSucceeded'];
     return $form;
 }
Exemple #17
0
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->getElementPrototype()->class("ajax");
     $form->addTextArea("content")->setAttribute("rows", 6)->setAttribute("cols", 7)->setRequired("Zadej prosím text komentáře.");
     $form->addSubmit("submit");
     $form->onSuccess[] = array($this, "addCommentFormSucceded");
     return $form;
 }
Exemple #18
0
 public function vytvorit()
 {
     $form = new Form();
     $form->addText('RodneCislo', 'Rodné číslo*:')->setRequired();
     $form->addPassword('heslo', 'Heslo*:')->setRequired();
     $form->addSubmit('prihlasit', 'Prihlásiť');
     $form->onSuccess[] = array($this, 'uspesne');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
Exemple #19
0
 protected function createComponentConsoleForm()
 {
     $form = new Form();
     $defaults = [];
     $form->setRenderer(new BootstrapRenderer());
     $uri = $this->request->getUrl();
     $scheme = $uri->scheme;
     if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
         $scheme = $_SERVER['HTTP_X_FORWARDED_PROTO'];
     }
     $port = '';
     if ($uri->scheme == 'http' && $uri->port != 80) {
         $port = ':' . $uri->port;
     }
     $url = $scheme . '://' . $uri->host . $port . '/api/' . $this->endpoint->getUrl();
     $form->addText('api_url', 'Api Url');
     $defaults['api_url'] = $url;
     $form->addText('method', 'Method');
     $defaults['method'] = $this->endpoint->getMethod();
     if ($this->authorization instanceof BearerTokenAuthorization) {
         $form->addText('token', 'Token')->setAttribute('placeholder', 'Enter token');
     } elseif ($this->authorization instanceof NoAuthorization) {
         $form->addText('authorization', 'Authorization')->setDisabled(true);
         $defaults['authorization'] = 'No authorization - global access';
     }
     $params = $this->handler->params();
     foreach ($params as $param) {
         $count = $param->isMulti() ? 5 : 1;
         for ($i = 0; $i < $count; $i++) {
             $key = $param->getKey();
             if ($param->isMulti()) {
                 $key = $key . '___' . $i;
             }
             if ($param->getAvailableValues() && is_array($param->getAvailableValues())) {
                 $c = $form->addSelect($key, $this->getParamLabel($param), array_combine($param->getAvailableValues(), $param->getAvailableValues()));
                 if (!$param->isRequired()) {
                     $c->setPrompt('Select ' . $this->getLabel($param));
                 }
             } elseif ($param->getAvailableValues() && is_string($param->getAvailableValues())) {
                 $c = $form->addText($key, $this->getParamLabel($param))->setDisabled(true);
                 $defaults[$key] = $param->getAvailableValues();
             } elseif ($param->getType() == InputParam::TYPE_FILE) {
                 $c = $form->addUpload($key, $this->getParamLabel($param));
             } elseif ($param->getType() == InputParam::TYPE_POST_RAW) {
                 $c = $form->addTextArea('post_raw', $this->getParamLabel($param))->setAttribute('rows', 10);
             } else {
                 $c = $form->addText($key, $this->getParamLabel($param));
             }
         }
     }
     $form->addSubmit('send', 'Otestuj')->getControlPrototype()->setName('button')->setHtml('<i class="fa fa-cloud-upload"></i> Try api');
     $form->setDefaults($defaults);
     $form->onSuccess[] = array($this, 'formSucceeded');
     return $form;
 }
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapRenderer());
     foreach ($this->systemSettings->items as $systemSetting) {
         $form->addText($systemSetting->name, $systemSetting->label)->setRequired("Zadej prosím hodnotu pro {$systemSetting->label}")->setDefaultValue($systemSetting->value);
     }
     $form->addSubmit("send", "Uložit změny")->setAttribute("class", "btn btn-default");
     $form->onSuccess[] = $this->changeSystemSettingsFormSucceeded;
     return $form;
 }
 public function create($role, $active, $blocked)
 {
     $form = new Form();
     $form->setRenderer(new BootstrapInlineRenderer());
     $form->addSelect("role")->setItems($this->roles)->setDefaultValue($role);
     $form->addSelect("active")->setItems(array("null" => "-- Aktivní? --", "1" => "Aktivní", "0" => "Neaktivní"))->setDefaultValue($active);
     $form->addSelect("blocked")->setItems(array("null" => "-- Blokovaní? --", "1" => "Blokovaní", "0" => "Neblokovaní"))->setDefaultValue($blocked);
     $form->addSubmit("send", "Filtrovat")->setAttribute("class", "btn btn-default");
     $form->onSuccess[] = $this->usersFilterFormSucceeded;
     return $form;
 }
Exemple #22
0
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->getElementPrototype()->class("ajax");
     $form->addTextArea("content")->setAttribute("rows", 5)->setRequired("Zadej prosím text příspěvku.");
     $form->addHidden("boardId", 0);
     $form->addSubmit("submit");
     $form->onSuccess[] = array($this, "addBoardFormSucceded");
     return $form;
 }
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->addPassword("actualPassword", "Aktuální heslo")->setRequired("Zadej prosím své aktuální heslo.")->addRule(Form::MIN_LENGTH, "Heslo musí mít alespoň %d znaků", \Model\Entities\User::MIN_PASSWORD_LENGTH);
     $form->addPassword("password", "Nové heslo")->setRequired("Zadej prosím heslo, pomocí kterého se budeš přihlašovat.")->addRule(Form::MIN_LENGTH, "Heslo musí mít alespoň %d znaků", \Model\Entities\User::MIN_PASSWORD_LENGTH);
     $form->addPassword("passwordVerify", "Nové heslo znovu")->setRequired("Zadej prosím stejné heslo ještě jednou.")->addRule(Form::EQUAL, "Zadaná hesla se musí shodovat", $form["password"]);
     $form->addSubmit("submit", "Změnit heslo")->setAttribute("class", "btn btn-default btn-lg btn-block");
     $form->onSuccess[] = array($this, "passwordChangeFormSucceeded");
     return $form;
 }
 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->addText("email", "Email")->setRequired("Zadejte prosím platnou emailovou adresu, pomocí které se budete přihlašovat.")->addRule(Form::EMAIL, "Zadejte prosím platnou emailovou adresu, pomocí které se poté budete přihlašovat.")->setType("email")->setDefaultValue($this->user->email)->addRule(Form::MAX_LENGTH, "Email může mít maximálně %d znaků", \Model\Entities\User::MAX_EMAIL_LENGTH);
     $form->addText("lastName", "Příjmení")->setRequired("Zadejte prosím své příjmení.")->setDefaultValue($this->user->lastName)->addRule(Form::MAX_LENGTH, "Příjmení může mít maximálně %d znaků", \Model\Entities\User::MAX_LAST_NAME_LENGTH);
     $form->addText("firstName", "Jméno")->setRequired("Zadejte prosím své křestní jméno.")->setDefaultValue($this->user->firstName)->addRule(Form::MAX_LENGTH, "Křestní jméno může mít maximálně %d znaků", \Model\Entities\User::MAX_FIRST_NAME_LENGTH);
     $form->addSubmit("submit", "Změnit údaje")->setAttribute("class", "btn btn-default btn-lg btn-block");
     $form->onSuccess[] = array($this, "personalChangeFormSucceeded");
     return $form;
 }
 protected function createComponentSignInForm()
 {
     $form = new Form();
     $renderer = new Forms\BT3Renderer();
     $form->setRenderer($renderer);
     $form->addText('username', 'Jméno:')->setRequired('Vložte uživatelské jméno.');
     $form->addPassword('password', 'Heslo:')->setRequired('Vložte heslo.');
     $form->addCheckbox('remember', 'Pamatovat přihlášení');
     $form->addSubmit('send', 'Přihlásit');
     $form->onSuccess[] = array($this, 'formSucceeded');
     return $form;
 }
 protected function createComponentSignInForm()
 {
     $form = new Form();
     $renderer = new Forms\BT3Renderer();
     $form->setRenderer($renderer);
     $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[] = array($this, 'formSucceeded');
     return $form;
 }
Exemple #27
0
 protected function createComponentPrispevekForm()
 {
     $form = new Form();
     $form->addTextArea('text', 'Text příspěvku', NULL, 10)->setRequired('Prosím zadejte text příspěvku.');
     $form->addSubmit('send', 'Uložit příspěvek');
     $form->addHidden('parent');
     $form->addHidden('id');
     $form->onSuccess[] = array($this, 'prispevekFormSucceeded');
     //$form->onValidate[] = array($this, 'nastenkaFormValidate');
     $form->setRenderer(new BootstrapRenderer());
     return $form;
 }
Exemple #28
0
 /**
  * @return \Nette\Application\UI\Form
  */
 public function create()
 {
     $form = new Form();
     $form->addGroup("Přihlásit se");
     $form->addText('email', 'Email:', 50)->setType("email")->setRequired(Form::FILLED, 'Vyplňte prosím email');
     $form->addPassword('password', 'Heslo:', 50)->addRule(Form::FILLED, 'Vyplňte prosím heslo:');
     $form->addCheckbox('persistent', 'Pamatovat si mě na tomto počítači');
     $form->addSubmit('login', 'Přihlásit se');
     $form->onSuccess[] = $this->processForm;
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
Exemple #29
0
 protected function createComponentSlozkaEditForm()
 {
     $form = new Form();
     $form->addText('name', 'Jméno složky')->addRule(Form::FILLED, 'Jméno složky musí být vyplněno');
     $form->addText('size', 'Velikost');
     $form->addText('comment', 'Poznámka');
     $form->addHidden('id');
     $form->addSubmit('send', 'Uložit');
     $form->onSuccess[] = array($this, 'slozkaEditFormSucceeded');
     $form->onValidate[] = array($this, 'slozkaEditFormValidate');
     $form->setRenderer(new BootstrapRenderer());
     return $form;
 }
 public function createComponentEntryForm()
 {
     $form = new Form();
     $form->addText('lname', 'Příjmení');
     $form->addText('fname', 'Jméno');
     $form->addText('nick', 'Nick');
     $form->addText('registration', 'Reg.');
     $form->addText('si_number', 'SI');
     $form->addSubmit('send', 'Zapsat')->getControlPrototype()->addClass('btn-primary');
     $form->onSuccess[] = [$this, 'entryFormSucceeded'];
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }