public function __construct(DbTable\Oznam $oznam, DbTable\Registracia $registracia, DbTable\Ikonka $ikonka, User $user)
  {
      $this->oznam = $oznam;
      $this->ikonka = $ikonka;
      $this->urovneReg = $registracia->hladaj_urovne(0, $user->isLoggedIn() ? $user->getIdentity()->id_registracia : 0)->fetchPairs('id', 'nazov');
  }
  /**
 * Formular pre editaciu oznamu
 * @param int $oznam_ucast Povolenie potvrdenia ucasti
 * @param boolean $send_e_mail_news Povolenie zasielania info e-mailov
 * @param boolean $oznam_title_image_en Povolenie titulneho obrazka
 * @param string $nazov_stranky Nazov stranky
 * @return Form
 */
  public function create($oznam_ucast, $send_e_mail_news, $oznam_title_image_en, $nazov_stranky)
  {
      $form = new Form();
      $form->addProtection();
      $form->addHidden("id");
      $form->addHidden("id_user_profiles");
      $form->addHidden("datum_zadania");
      $form->addDatePicker('datum_platnosti', 'Dátum platnosti')->addRule(Form::FILLED, 'Dátum platnosti musí byť zadaný!');
      $form->addText('nazov', 'Nadpis:', 50, 80)->addRule(Form::MIN_LENGTH, 'Nadpis musí mať spoň %d znakov!', 3)->setRequired('Názov musí byť zadaný!');
      $form->addSelect('id_registracia', 'Povolené prezeranie pre min. úroveň:', $this->urovneReg);
      if ($oznam_ucast) {
          $form->addCheckbox('potvrdenie', ' Potvrdenie účasti');
      } else {
          $form->addHidden('potvrdenie');
      }
      if ($send_e_mail_news) {
          $form->addCheckbox('posli_news', ' Posielatie NEWS o tejto aktualite');
      } else {
          $form->addHidden("posli_news", FALSE);
      }
      if (!$oznam_title_image_en) {
          //$this->oznam_title_image_en
Example #2
0
  /**
 * @param DbTable\Users $users
 * @param DbTable\User_profiles $users_profiles
 * @param DbTable\Registracia $registracia
 * @param \App\AdminModule\Presenters\Forms\User\User $user */
  public function __construct(DbTable\Users $users, DbTable\User_profiles $users_profiles, DbTable\Registracia $registracia, User $user)
  {
      $this->users = $users;
      $this->users_profiles = $users_profiles;
      $this->id_reg = $user->isLoggedIn() ? $user->getIdentity()->id_registracia : 0;
      $this->urovneReg = $registracia->hladaj_urovne(0, $this->id_reg)->fetchPairs('id', 'nazov');
      //Hodnoty id=>nazov pre formulare z tabulky registracia
  }
  /**
 * Edit hlavne menu form component factory.
 * @return Nette\Application\UI\Form
 */
  public function create($user_view_fields)
  {
      $form = new Form();
      $form->addProtection();
      $form->addHidden('id');
      $form->addHidden('id_users');
      $form->addHidden('created');
      $form->addHidden('modified');
      $form->addText('meno', 'Meno:', 50, 80)->addRule(Form::MIN_LENGTH, 'Meno musí mať spoň %d znakov!', 3)->setRequired('Meno musí byť zadané!');
      $form->addText('priezvisko', 'Priezvisko:', 50, 80)->addRule(Form::MIN_LENGTH, 'Priezvisko musí mať spoň %d znakov!', 3)->setRequired('Priezvisko musí byť zadané!');
      $form->addText('username', 'Užívateľské meno', 50, 50)->addRule(Form::MIN_LENGTH, 'Užívateľské meno musí mať aspoň %s znakov', 3)->setRequired('Užívateľské meno musí byť zadané!');
      $form->addText('email', 'E-mailová adresa', 50, 50)->setType('email')->addRule(Form::EMAIL, 'Musí byť zadaná korektná e-mailová adresa(napr. janko@hrasko.sk)')->setRequired('E-mailová adresa musí byť zadaná!');
      if ($this->id_reg > 2) {
          $form->addSelect('id_registracia', 'Úroveň registrácie člena:', $this->urovneReg);
      }
      if ($user_view_fields["rok"]) {
  /**
 * Formular pre editaciu udajov
 * @param boolean $admin
 * @param array $druh
 * @return Nette\Application\UI\Form
 */
  public function create($admin, $druh, $ur_reg)
  {
      $this->ur_reg = $ur_reg;
      $form = new Form();
      $form->addProtection();
      $form->addGroup();
      $form->addHidden('id');
      $form->addHidden('id_udaje_typ');
      if ($admin) {
          $form->addText('nazov', 'Názov prvku:', 20, 20)->addRule(Form::MIN_LENGTH, 'Názov musí mať spoň %d znaky!', 2)->setAttribute('class', 'heading')->setRequired('Názov musí byť zadaný!');
          $form->addText('comment', 'Komentár k hodnote :', 90, 255)->addRule(Form::MIN_LENGTH, 'Komentár musí mať spoň %d znaky!', 2)->setRequired('Komentár musí byť zadaný!');
      } else {
          $form->addHidden('nazov');
          $form->addHidden('comment');
      }
      $form->addText('text', 'Hodnota prvku:', 90, 255)->setRequired('Hodnota prvku musí byť zadaná!');
      if ($admin) {
          $form->addCheckbox('spravca', ' Povolená zmena pre správcu')->setDefaultValue(1);
          $form->addCheckbox("druh_null", " Hodnota druhu je NULL")->setDefaultValue(1)->addCondition(Form::EQUAL, TRUE)->toggle("druh", FALSE);
          $form->addGroup()->setOption('container', Html::el('fieldset')->id("druh"));
          $form->addSelect('id_druh', 'Druhová skupina pre nastavenia:', $druh)->setDefaultValue(1);
          $form->setCurrentGroup(NULL);
  /**
 * Edit hlavne menu form component factory.
 * @return Nette\Application\UI\Form
 */
  public function create($iko, $upload_size)
  {
      $form = new Form();
      $form->addProtection();
      $form->addHidden("id");
      $form->addHidden("id_lang");
      $form->addHidden("spec_nazov");
      $form->addUpload('title_image', 'Titulný obrázok:')->setOption('description', 'Odporúčaný rozmer obrázku je: 90x70px alebo násobky tejto veľkosti. Inak môže dôjsť k deformácii alebo orezaniu obrázku pri ukladaní!')->addCondition(Form::FILLED)->addRule(Form::IMAGE, 'Titulný obrázok musí byť JPEG, PNG alebo GIF.')->addRule(Form::MAX_FILE_SIZE, 'Maximálna veľkosť súboru je 64 kB.', 64 * 1024);
      $form->addText('nazov', 'Názov produktu:', 50, 50)->setRequired('Názov musí byť zadaný!');
      $form->addRadioList('tepkat', 'Tepelná kategória:', $iko)->getSeparatorPrototype()->setName(NULL);
      $form->addText('vyska', 'Výška[mm]:', 5, 5)->addRule(Form::RANGE, 'Výška musí byť v rozsahu od %d do %d mm!', array(0, 4000))->setRequired('Výška musí byť zadaná!');
      $form->addText('sirka', 'Šírka[mm]:', 5, 5)->addRule(Form::RANGE, 'Šírka musí byť v rozsahu od %d do %d mm!', array(0, 2000))->setRequired('Šírka musí byť zadaná!');
      $form->addText('hlbka', 'Hĺbka[mm]:', 5, 5)->addRule(Form::RANGE, 'Hĺbka musí byť v rozsahu od %d do %d mm!', array(0, 2000))->setRequired('Hĺbka musí byť zadaná!');
      $form->addText('hmotnost', 'Hmotnosť[kg]:', 5, 5)->addRule(Form::RANGE, 'Hmotnosť musí byť v rozsahu od %d do %d kg!', array(0, 3500))->setRequired('Hmotnosť musí byť zadaná!');
      $form->addText('bottom_plinth_weight', 'Hmotnosť spodného podstavca[kg]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Hmotnosť spodného podstavca musí byť v rozsahu od %d do %d kg!', array(0, 2000));
      $form->addCheckbox('copatible_aurum', ' Kompatibilné s Aurum Pellet Unit');
      $form->addText('termal_energy', 'Tepelná energia[kWh]:', 5, 5)->addRule(Form::RANGE, 'Tepelná energia musí byť v rozsahu od %d do %d kWh!', array(0, 200))->setRequired('Tepelná energia musí byť zadaná!');
      $form->addText('heating_time', 'Čas spaľovania[h:min]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::PATTERN, 'Čas spaľovania musí byť zapísaný v tvare napr.:02:30', '([0-9]\\s*){2}:([0-9]\\s*){2}');
      $form->addText('heating_occasion', 'Max. množstvo dreva[kg]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Max. množstvo dreva musí byť v rozsahu od %d do %d kg!', array(0, 100));
      $form->addText('forewood_lenght', 'Dĺžka dreva do rúry na pečenie[cm]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Dĺžka dreva do rúry na pečenie musí byť v rozsahu od %d do %d cm!', array(0, 100));
      $form->addText('firewood_lenght', 'Dĺžka dreva[cm]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Dĺžka dreva musí byť v rozsahu od %d do %d cm!', array(0, 100));
      $form->addText('nominal_heat_output', 'Nominálny tepelný výkon[kW]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Nominálny tepelný výkon musí byť v rozsahu od %d do %d kW!', array(0, 15));
      $form->addText('nominal_heat_time', 'Nominálny čas[h]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Nominálny čas musí byť v rozsahu od %d do %d h!', array(0, 50));
      $form->addText('heat_release_time100', 'Tepelná akumulačná kapacita, 100 percent maximálneho výkonu[h]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Tepelná akumulačná kapacita musí byť v rozsahu od %d do %d h!', array(0, 50));
      $form->addText('heat_release_time50', 'Tepelná akumulačná kapacita, 50 percent maximálneho výkonu[h]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Tepelná akumulačná kapacita musí byť v rozsahu od %d do %d h!', array(0, 100));
      $form->addText('heat_release_time25', 'Tepelná akumulačná kapacita, 25 percent maximálneho výkonu[h]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Tepelná akumulačná kapacita musí byť v rozsahu od %d do %d h!', array(0, 100));
      $form->addText('efficiency', 'Účinnosť[%]:', 5, 5)->addCondition(Form::FILLED)->addRule(Form::RANGE, 'Účinnosť musí byť v rozsahu od %d do %d %!', array(0, 100));
      $form->addUpload('pec_pdf', 'Katalógový list vo formáte pdf:')->setOption('description', sprintf('Max veľkosť prílohy v bytoch %s kB', $upload_size / 1024))->addCondition(Form::FILLED)->addRule(Form::MIME_TYPE, 'Katalógový list musí byť vo formáte pdf!', 'application/pdf')->addRule(Form::MAX_FILE_SIZE, 'Max veľkosť prílohy može byť v bytoch %d B', $upload_size);
      $form->addSubmit('uloz', 'Ulož produkt');
 /**
  * @return Form
  */
 public function create($role)
 {
     $rights = $this->database->table('rights')->fetchPairs('id', 'name');
     $form = new Form();
     $form->addHidden('id');
     $form->addText('username', 'uživatelské jméno: ')->addRule(Form::FILLED, 'Zadejte prosím jméno.');
     $form->addText('email', 'email: ')->addRule(Form::FILLED, 'Zadejte prosím email.')->addRule(Form::EMAIL, 'Email by měl mít platný formát');
     if (in_array("admin", $role)) {
         // editace prav jen adminem
         $form->addSelect('rights_id', 'level práv: ', $rights);
     }
     $form->addSubmit('submit', 'uložit');
     $form->addProtection('Vypršel časový limit, odešlete formulář znovu');
     //bootstrap vzhled
     $renderer = $form->getRenderer();
     $renderer->wrappers['controls']['container'] = NULL;
     $renderer->wrappers['pair']['container'] = 'div class=form-group';
     $renderer->wrappers['pair']['.error'] = 'has-error';
     $renderer->wrappers['control']['container'] = '';
     $renderer->wrappers['label']['container'] = 'div class="control-label col-sm-5"';
     $renderer->wrappers['control']['description'] = 'span class=help-block';
     $renderer->wrappers['control']['errorcontainer'] = 'span class=help-block';
     $form->getElementPrototype()->class('form-horizontal col-sm-12');
     return $form;
 }
 protected function createComponentBackupDatabaseForm()
 {
     $form = new Form();
     $form->addSubmit('backup', 'Provést zálohu')->getControlPrototype()->onClick = 'return confirm(\'Skutečně chcete provést zálohu databáze?\');';
     $form->onSuccess[] = [$this, 'processBackup'];
     $form->addProtection();
     return $form;
 }
 protected function createComponentDeleteForm()
 {
     $form = new Form();
     $form->addSubmit('delete', 'Zmaž')->onClick[] = array($this, 'deleteFormDelete');
     $form->addSubmit('cancel', 'Storno')->onClick[] = array($this, 'deleteFormCancel');
     $form->addProtection();
     return $form;
 }
Example #8
0
 protected function createComponentDeleteForm()
 {
     $form = new Form();
     $form->addSubmit('cancel', 'Cancel')->onClick[] = $this->formCancelled;
     $form->addSubmit('delete', 'Delete')->setAttribute('class', 'default')->onClick[] = $this->deleteFormSucceeded;
     $form->addProtection();
     return $form;
 }
Example #9
0
 /**
  * @return Form
  */
 protected function createComponentForm()
 {
     $form = new Form();
     $form->addProtection();
     $form->addHidden('data')->setRequired();
     $form->onSuccess[] = [$this, 'formSuccess'];
     return $form;
 }
Example #10
0
 protected function createComponentDeleteForm()
 {
     $form = new Form();
     $form->addSubmit('delete', 'Zmaz')->onClick[] = callback($this, 'deleteFormSucceeded');
     $form->addSubmit('cancel', 'Storno')->onClick[] = callback($this, 'cancelFormSubmitted');
     $form->addProtection();
     return $form;
 }
Example #11
0
 /**
  * @return Form
  */
 public function init(Form $form)
 {
     $form->addText('username', 'Uživatelské jméno')->setAttribute('placeholder', "Uživatelské jméno")->setRequired('Prosím, vyplňtě své jméno.');
     $form->addPassword('password', 'Heslo:')->setAttribute('placeholder', "Heslo")->setRequired('Prosím, vyplně své heslo.');
     $form->addCheckbox('remember', ' Zapamatovat přihlášení');
     $form->addSubmit('send', 'Přihlásit se');
     $form->addProtection();
 }
 protected function createComponentDeleteListingForm()
 {
     $form = new Form();
     $form->addText('check', 'Pro smazání výčetky napište do pole "smazat".')->addRule(Form::FILLED, 'Kontrola musí být vyplněna.')->addRule(Form::EQUAL, 'Pro smazání výčetky musí být vyplňeno správné kontrolní slovo.', 'smazat')->setHtmlId('listing-check-input');
     $form->addSubmit('delete', 'Odstranit výčetku')->setHtmlId('listing-remove-button')->onClick[] = [$this, 'processDeleteListing'];
     $form->addSubmit('cancel', 'Vrátit se zpět')->setValidationScope(false)->onClick[] = [$this, 'processCancel'];
     $form->addProtection();
     return $form;
 }
Example #13
0
 /**
  * @Actions itemAutocomplete
  */
 protected function createComponentLocalitiesTableForm()
 {
     $form = new Form();
     $form->addText('search', 'Filtr:', 10)->setHtmlId('search');
     $form->addSubmit('hide', 'Odebrat označené')->setAttribute('class', 'ajax')->onClick[] = [$this, 'processHide'];
     $form->addSubmit('filter', 'Vyhledej')->setAttribute('class', 'ajax')->onClick[] = [$this, 'processFilter'];
     $form->addProtection();
     return $form;
 }
Example #14
0
 protected function createComponentMessagesActions()
 {
     $form = new Form();
     $form->addCheckbox('checkAll', '')->setHtmlId('checkAll');
     $form->addSubmit('delete', 'Odstranit označené')->setAttribute('class', 'ajax')->onClick[] = $this->processDeleteMessages;
     $form['delete']->getControlPrototype()->onClick = 'return confirm(\'Skutečně chcete odstranit všechny označené zprávy?\');';
     $form->addProtection();
     return $form;
 }
 protected function createComponentSendKeyForm()
 {
     $form = new Form();
     $form->addText('email', 'E-mailová adresa příjemce', 22)->setRequired('Zadejte prosím E-mail, na který se má pozvánka odeslat.')->addRule(Form::EMAIL, 'Zadejte platnou E-Mailovou adresu.');
     $form->addSubmit('send', 'Odeslat pozvánku');
     $form->onSuccess[] = [$this, 'processCreateInvitation'];
     $form->addProtection();
     return $form;
 }
Example #16
0
 protected function createComponentLoginForm($name)
 {
     $form = new Form($this, $name);
     $form->addText('username', 'Uživatelské jméno:')->addRule(Form::FILLED, 'Prosím zadejte uživatelské jméno.');
     $form->addPassword('password', 'Heslo:')->addRule(Form::FILLED, 'Prosím zadejte heslo.');
     $form->addProtection('Prosím odešlete přihlašovací údaje znovu (vypršela platnost tzv. bezpečnostního tokenu).');
     $form->addSubmit('send', 'Přihlásit se!');
     $form->onSuccess[] = array($this, 'loginFormSubmitted');
 }
Example #17
0
 /**
  * Create standard Nette form
  * @param bool|true $secured Enable Cross-Site Request Forgery Protection
  * @return Form|IForm
  */
 public function create($secured = true)
 {
     $form = new Form();
     if ($secured) {
         $form->addProtection('Vypršel časový limit, odešlete formulář znovu');
     }
     $form->setTranslator($this->translator);
     return $form;
 }
  private $hlavne_menu;
  /** @var \Nette\Database\Table\Selection */
  private $registracia;
  /**
 * @param DbTable\Hlavne_menu $hlavne_menu
 * @param DbTable\Registracia $registracia */
  public function __construct(DbTable\Hlavne_menu $hlavne_menu, DbTable\Registracia $registracia, User $user)
  {
      $this->hlavne_menu = $hlavne_menu;
      $this->registracia = $registracia->urovneReg($user->getIdentity()->id_registracia);
  }
  private $hlavne_menu;
  /** @var DbTable\User_profiles */
  private $user_profiles;
  /**
 * @param DbTable\Hlavne_menu $hlavne_menu
 * @param DbTable\User_profiles $user_profiles */
  public function __construct(DbTable\Hlavne_menu $hlavne_menu, DbTable\User_profiles $user_profiles)
  {
      $this->hlavne_menu = $hlavne_menu;
      $this->user_profiles = $user_profiles;
  }
Example #20
0
class SignInFormFactory
{
    /** @var Security\User */
    protected $user;
    /** @param Security\User $user   */
    public function __construct(Security\User $user)
    {
        $this->user = $user;
    }
    /**
   * Prihlasovaci formular
 protected function createComponentResultPdf()
 {
     $form = new Form();
     $form->addComponent(new UserPdfSettingsContainer($this->companyParameters), 'userSettings');
     $form->addComponent(new ListingsPdfSettingsContainer(), 'listingsSettings');
     $form->addSubmit('generatePdf', 'Stáhnout PDF')->onClick[] = [$this, 'generatePdf'];
     $form->addSubmit('reset', 'Reset nastavení')->onClick[] = [$this, 'processReset'];
     $form->addProtection();
     return $form;
 }
 /**
  * Album delete form component factory.
  * @return mixed
  */
 protected function createComponentDeleteForm()
 {
     $form = new Form();
     $form->addHidden('id', $this->getParameter('id'));
     $form->addSubmit('cancel', 'Cancel');
     $form->addSubmit('delete', 'Delete')->setAttribute('class', 'default');
     $form->onSuccess[] = $this->deleteFormSubmitted;
     $form->addProtection('Please submit this form again (security token has expired).');
     return $form;
 }
Example #23
0
 /**
  * Pridanie/editacia prispevku form component factory.
  * @return Nette\Application\UI\Form
  */
 protected function createComponentKomentarForm()
 {
     $form = new Form();
     $form->addProtection();
     $form->addTextArea('text', $this->trLang('KomentarForm_text'))->setAttribute('rows', $this->textA_rows)->setAttribute('cols', $this->textA_cols);
     $form->addHidden('id');
     $form->addHidden('id_user_profiles');
     $form->addSubmit('uloz', $this->trLang('KomentarForm_uloz'));
     $form->onSuccess[] = [$this, 'onZapisKomentar'];
     return $form;
 }
Example #24
0
 protected function createComponentForm()
 {
     $form = new Form();
     $form->addSubmit('save', 'Save');
     if (!$this->authorizator->isAllowed($this->user, 'user_role', 'edit')) {
         $form['save']->setDisabled();
     }
     $form->onSuccess[] = [$this, 'processPrivileges'];
     $form->addProtection();
     return $form;
 }
 protected function createComponentCategoryForm()
 {
     $form = new Nette\Application\UI\Form();
     $form->addText('name', 'Název:')->setRequired('Pole "Název" je povinné.')->setAttribute('autofocus');
     $items = array('e' => 'Výdajová', 'i' => 'Příjmová');
     $form->addSelect('type', 'Typ:')->setItems($items)->setRequired('Pole "Název" je povinné.')->setPrompt('Zvolte typ');
     $form->addSubmit('send', 'Přidat');
     $form->onSuccess[] = $this->categoryFormSucceeded;
     $form->addProtection('Vypršel časový limit, odešlete formulář znovu');
     return $form;
 }
Example #26
0
 public function create()
 {
     $form = new Form();
     $form->addText('description', 'Popis výčetky:', 25, 40);
     $form->addText('hourlyWage', 'Základní mzda:', null, 4)->addCondition(Form::FILLED)->addRule(Form::PATTERN, 'Do pole "základní mzda" lze vyplnit pouze kladná celá čísla.', '\\d+');
     $form->addSelect('month', 'Měsíc:', TimeUtils::getMonths());
     $form->addSelect('year', 'Rok:', TimeUtils::generateYearsForSelect());
     $form->addSubmit('save', 'Vytvořit výčetku')->setOmitted();
     $form->addProtection();
     return $form;
 }
Example #27
0
 protected function createComponentForm()
 {
     $form = new UI\Form();
     $form->addProtection();
     $form->addText('username', 'Uživatelské přihlašovací jméno:')->setDefaultValue($this->account->username)->setRequired('Zadejte prosím přihlašovací jméno.');
     $form->addPassword('password', 'Nové heslo k tomuto účtu:')->setRequired('Zadejte prosím své stávající, nebo nové heslo.');
     $form->addPassword('passwordVerify', 'Heslo pro kontrolu:')->setRequired('Zadejte prosím heslo ještě jednou pro kontrolu.')->addRule(UI\Form::EQUAL, 'Hesla se neshodují.', $form['password']);
     $form->addSelect('role', 'Role:', $this->roles)->setDefaultValue($this->account->role);
     $form->addSubmit('save', 'Uložit změny');
     $form->onSuccess[] = [$this, 'formSucceeded'];
     return $form;
 }
Example #28
0
 protected function createComponentSignOutForm()
 {
     $form = new UI\Form();
     $form->addProtection();
     $form->addSubmit('logout', 'Odhlásit se')->setAttribute('class', 'logout');
     $form->onSuccess[] = function () {
         $this->getUser()->logout();
         $this->flashMessage('Odhlášení bylo úpěšné.', 'info');
         $this->redirect(':Auth:Sign:in');
     };
     return $form;
 }
 /**
  * @param User $user
  * @return Form
  */
 public function create(User $user)
 {
     $this->user = $user;
     $form = new Form();
     $form->addPassword('currentPassword', 'Aktuální heslo')->setRequired('Zadejte své aktuální heslo');
     $form->addPassword('password', 'Nové heslo:')->setRequired('Vyplňte své heslo.')->addRule(Form::MIN_LENGTH, 'Heslo musí mít alespoň %d znaků.', 5)->setAttribute('placeholder', 'Zadejte nové heslo')->setHtmlId('password-input');
     $form->addPassword('password2', 'Kontrola hesla:')->setRequired('Vyplňte kontrolu hesla.')->addRule(Form::EQUAL, 'Zadaná hesla se musí shodovat.', $form['password'])->setAttribute('placeholder', 'Znovu zadejte své heslo')->setHtmlId('password-control-input');
     $form->addSubmit('save', 'Změnit heslo')->setHtmlId('password-save-button');
     $form->addProtection();
     $form->onSuccess[] = [$this, 'processChangePassword'];
     return $form;
 }
Example #30
0
 protected function createComponentForm()
 {
     $form = new Form();
     $form->setTranslator($this->translator->domain('users.roleRemoval.actions'));
     $form->addSubmit('remove', 'remove')->onClick[] = [$this, 'removeRole'];
     if (!$this->authorizator->isAllowed($this->user, 'user_role', 'remove')) {
         $form['remove']->setDisabled();
     }
     $form->addSubmit('cancel', 'cancel')->onClick[] = [$this, 'cancel'];
     $form->addProtection();
     return $form;
 }