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
 public function createComponentRaceForm()
 {
     $validator = function ($item) {
         return $this->race->freeRaceid($item->value);
     };
     $form = new Form();
     $i = $form->addText('raceid', 'ID závodu:');
     if ($this->getAction() == 'add') {
         $i->setRequired('ID závodu je povinné')->addRule(Form::LENGTH, 'Délka ID musí být 4 - 8 znaků', array(4, 8))->addRule($validator, 'ID je již použito.');
     } else {
         $i->setDisabled(TRUE);
     }
     $form->addText('name', 'Název:');
     $form->addDateTimePicker('datetime_0', 'Datum a čas:')->setRequired('Datum a čas jsou povinné.');
     $form->addSelect('type', 'Typ závodu', self::$race_type);
     $form->addSelect('opt_preftype', 'Druh závodu', self::$race_kind);
     $form->addSelect('opt_incomplete', 'Při chybějící kontrole', self::$inco_list);
     $form->addCheckbox('opt_autocat', 'Automatická kategorie');
     $form->addCheckbox('opt_namefrsi', 'Doplnit jméno z SI čipu');
     $form->addCheckbox('opt_addnew', 'Hodnotit i nepřihlášené');
     $form->addTextArea('descr', 'Popis:');
     $form->addSubmit('send', 'OK');
     $form->addSubmit('cancel', 'Zpět')->setValidationScope(false)->onClick[] = [$this, 'formCancelled'];
     if ($this->getAction() == 'add') {
         $form->onSuccess[] = [$this, 'addRaceFormSucceeded'];
     } else {
         $form->onSuccess[] = [$this, 'editRaceFormSucceeded'];
     }
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
Example #3
0
 /**
  * @return Form
  */
 public function create($otherUser = '', $privilegesEdit = false)
 {
     $form = new Form();
     if (!empty($otherUser)) {
         $user = $otherUser;
         $form->addHidden('id', $otherUser->id);
     } else {
         $user = $this->user;
     }
     $form->addUpload('photo', 'Fotka')->addRule($form::MAX_FILE_SIZE, 'Maximální velikost fotky je 10MB', 80000000);
     $form->addText('nickName', 'Přihlašovací jméno')->setValue($user->nickName)->setOption('description', Html::el('p')->setHtml('Pokud chcete můžete pro jednodušší přihlašování zadat jméno'))->addCondition(Form::FILLED)->addRule(Form::MIN_LENGTH, 'Jméno musí mít alespoň %d znaky', 3);
     $form->addText('name', 'Jméno k zobrazení')->setValue($user->name);
     if ($privilegesEdit) {
         $form->addText('title', 'Titul')->setValue($user->title)->setOption('description', Html::el('p')->setHtml('Titul měnitelný administrátorem přidaný před jméno'));
     }
     $date = $this->parseDateForm();
     $form->addSelect('day', 'Den narození', $date['days'])->setValue($date['day']);
     $form->addSelect('month', 'Měsíc narození', $date['months'])->setValue($date['month']);
     $form->addSelect('year', 'Rok narození', $date['years'])->setValue($date['year']);
     $form->addSelect('gender', 'Pohlaví', ['ma' => 'Muž', 'fe' => 'Žena', 'no' => 'Neuvedeno'])->setValue($user->gender);
     $form->addCheckbox('wall', 'Povolit zeď')->setValue($user->wall == 1 ? true : false);
     $form->addCheckbox('mailList', 'Posílat od nás maily')->setValue($user->mailList == 1 ? true : false);
     $form->addTextArea('about', 'O mě')->setValue($user->about);
     if ($privilegesEdit) {
         $this->editPrivileges($form, $user->permissions);
     }
     $form->addSubmit('submit', 'Uložit');
     $form->addProtection('Vypršel časový limit, odešlete formulář znovu');
     $form->onSuccess[] = [$this, 'formSucceeded'];
     return $form;
 }
  /**
 * 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);
Example #5
0
 protected function createComponentPageEditor()
 {
     $form = new Form();
     $form->addText('name', 'Název stránky')->setRequired();
     $form->addText('heading', 'Nadpis')->setRequired();
     $form->addTextArea('body', 'Obsah');
     $form->addCheckbox('hidden', 'Výstřižek stránky');
     $form->addHidden('id');
     $form->addSubmit('send', 'Uložit');
     $form->onSuccess[] = function (Form $f) {
         $val = $f->values;
         //Update page
         if ($val->id) {
             $this->pages->find($val->id)->update($val);
             $msg = $this->flashMessage("Stránka byla upravena", 'success');
             $msg->title = 'A je tam!';
             $msg->icon = 'check';
             $this->logger->log('CMS', 'edit', "%user% uprvila(a) stránku {$val->name}");
         } else {
             $r = $this->pages->create($val);
             $msg = $this->flashMessage("Stránka byla vytvořena.", 'success');
             $msg->title = 'A je tam!';
             $msg->icon = 'check';
             $this->redirect('this', ['id' => $r->id]);
             $this->logger->log('CMS', 'create', "%user% vytvořil(a) stránku {$val->name}");
         }
         $this->redirect('this');
     };
     return $form;
 }
 protected function createComponentSignInForm()
 {
     $form = new Form();
     $form->addText('username', 'Uživatelské jméno:')->setRequired('Prosím vyplňte své uživatelské jméno.');
     $form->addPassword('password', 'Heslo:')->setRequired('Prosím vyplňte své heslo.');
     $form->addCheckbox('remember', 'Zůstat přihlášen');
     $form->addSubmit('send', 'Přihlásit');
     // setup form rendering
     $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'] = 'div class="col-sm-6"';
     $renderer->wrappers['label']['container'] = 'div class="col-sm-3 control-label"';
     $renderer->wrappers['control']['description'] = 'span class=help-block';
     $renderer->wrappers['control']['errorcontainer'] = 'span class=help-block';
     // make form and controls compatible with Twitter Bootstrap
     $form->getElementPrototype()->class('form-horizontal');
     foreach ($form->getControls() as $control) {
         if ($control instanceof Controls\Button) {
             $control->getControlPrototype()->addClass(empty($usedPrimary) ? 'btn btn-primary' : 'btn btn-default');
             $usedPrimary = TRUE;
         } elseif ($control instanceof Controls\TextBase || $control instanceof Controls\SelectBox || $control instanceof Controls\MultiSelectBox) {
             $control->getControlPrototype()->addClass('form-control');
         } elseif ($control instanceof Controls\Checkbox || $control instanceof Controls\CheckboxList || $control instanceof Controls\RadioList) {
             $control->getSeparatorPrototype()->setName('div')->addClass($control->getControlPrototype()->type);
         }
     }
     $form->onSuccess[] = array($this, 'signInFormSucceeded');
     return $form;
 }
Example #7
0
 protected function createComponentSaleForm()
 {
     $form = new UI\Form();
     $form->addTextArea('text', 'Popis akce:')->setAttribute('class', 'tinyMCE');
     $form->addText('color', 'Barva písma')->addRule($form::PATTERN, 'Barva písma je ve špatném formátu, použijte #RRGGBB', '(\\#[0-9A-Fa-f]{6})?')->setAttribute('type', 'color');
     $form->addText('bgcolor', 'Barva pozadí')->addRule($form::PATTERN, 'Barva pozadí je ve špatném formátu, použijte #RRGGBB', '(\\#[0-9A-Fa-f]{6})?')->setAttribute('type', 'color');
     $form->addText('border', 'Barva ohraničení')->addRule($form::PATTERN, 'Barva ohraničení je ve špatném formátu, použijte #RRGGBB', '(\\#[0-9A-Fa-f]{6})?')->setAttribute('type', 'color');
     $form->addText('start', 'Počátek akce')->setAttribute('type', 'datetime-local');
     $form->addText('end', 'Konec akce')->setAttribute('type', 'datetime-local');
     $form->addCheckbox('unlimited', 'Neomezená platnost');
     $form->addCheckbox('enable', 'Aktivní');
     $form->addSubmit('save', 'Uložit')->setAttribute('class', 'btn btn-primary');
     $form->onValidate[] = array($this, 'saleFormValidate');
     $form->onSuccess[] = array($this, 'saleFormSucceeded');
     return $form;
 }
 /**
  * @return Form
  */
 public function create($kat = null, $page = null, $id_user = null)
 {
     // nastaveni paginatoru
     $paginator = new Nette\Utils\Paginator();
     $paginator->setItemsPerPage(6);
     // def počtu položek na stránce
     $paginator->setPage($page);
     // def stranky
     // selekce upozorneni
     $alerts = $this->database->findAll('alert')->where('id_user', $id_user);
     if ($kat == 'read') {
         // prectene
         $alerts = $alerts->where('visited', 1);
     } else {
         // neprectene
         $alerts = $alerts->where('visited', 0);
     }
     $alerts = $alerts->order('added DESC')->order('id DESC');
     // prideleni produktu na stranku
     $paginator->setItemCount($alerts->count('*'));
     $this->alerts = $alerts->limit($paginator->getLength(), $paginator->getOffset());
     $this->kat = $kat;
     // form
     $form = new Form();
     $form->getElementPrototype()->class('ajax form');
     foreach ($this->alerts as $alert) {
         $form->addCheckbox($alert->id);
     }
     $form->addSubmit('btndel', 'Smazat upozornění')->setAttribute('class', 'btn btn-primary');
     $form->addSubmit('btnvis', 'Označit jako přečtené')->setAttribute('class', 'btn btn-default');
     $form->onSuccess[] = array($this, 'formSucceeded');
     $form->onError[] = array($this, 'formNotSucceeded');
     return $form;
 }
Example #9
0
 protected function configure(Form $form)
 {
     $form->addText('email', 'locale.form.email')->addRule($form::EMAIL, 'locale.form.email_not_in_order')->setRequired('locale.form.email_required');
     $form->addPassword('password', 'locale.form.password')->setRequired('locale.form.password_required');
     $form->addCheckbox('remember', 'locale.form.remember');
     $form->addSubmit('submit', 'locale.form.sign_in');
 }
Example #10
0
 /**
  * LogIn-in form factory.
  * @return Nette\Application\UI\Form
  */
 protected function createComponentLogInForm()
 {
     $form = new Nette\Application\UI\Form();
     $form->setTranslator($this->translator->domain('ui'));
     $form->addText('username', 'login-username')->setRequired('please-enter-your-username')->setAttribute('autofocus');
     $form->addPassword('password', 'login-password')->setRequired('');
     $form->addCheckbox('remember', 'keep-me-signed-in');
     $form->addSubmit('send', 'log-in');
     $form->onSuccess[] = $this->logInFormSucceeded;
     // setup form rendering for Twitter Bootstrap
     $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'] = 'div class=col-sm-3';
     $renderer->wrappers['label']['container'] = 'div class="col-sm-3 control-label"';
     $renderer->wrappers['control']['description'] = 'span class=help-block';
     $renderer->wrappers['control']['errorcontainer'] = 'span class=help-block';
     // make form and controls compatible with Twitter Bootstrap
     $form->getElementPrototype()->class('form-horizontal');
     foreach ($form->getControls() as $control) {
         if ($control instanceof Controls\Button) {
             $control->getControlPrototype()->addClass(empty($usedPrimary) ? 'btn btn-primary' : 'btn btn-default');
             $usedPrimary = TRUE;
         } elseif ($control instanceof Controls\TextBase || $control instanceof Controls\SelectBox || $control instanceof Controls\MultiSelectBox) {
             $control->getControlPrototype()->addClass('form-control');
         } elseif ($control instanceof Controls\Checkbox || $control instanceof Controls\CheckboxList || $control instanceof Controls\RadioList) {
             $control->getSeparatorPrototype()->setName('div')->addClass($control->getControlPrototype()->type);
         }
     }
     return $form;
 }
Example #11
0
 protected function createComponentSettingForm()
 {
     $layoutPairs = $this->layouts->findAll()->fetchPairs('id', 'slug');
     $themePairs = $this->themes->findAll()->fetchPairs('id', 'slug');
     $form = new Form();
     $form->addSelect('layouts_id', 'Layout:', $layoutPairs)->setDefaultValue($this->settings->active()->layouts_id);
     $form->addSelect('themes_id', 'Theme:', $themePairs)->setDefaultValue($this->settings->active()->themes_id);
     $form->addText('ga_tracking_id', 'ga_tracking_id:')->setDefaultValue($this->settings->active()->ga_tracking_id);
     $form->addCheckbox('eu_cookie', 'Zapnout eu_cookie')->setDefaultValue($this->settings->active()->eu_cookie);
     $form->addCheckbox('noindex_nofollow', 'Zakázat prohledávání a indexování obsahu webu')->setDefaultValue($this->settings->active()->noindex_nofollow);
     $form->addText('navbar_brand', 'Navbar Brand:')->setDefaultValue($this->settings->active()->navbar_brand);
     $form->addText('description', 'Description:')->setDefaultValue($this->settings->active()->description);
     $form->addSubmit('set', 'Nastavit PW-PRESS');
     $form->onSuccess[] = array($this, 'settingFormSucceeded');
     return $form;
 }
Example #12
0
 protected function createComponentTagForm()
 {
     $form = new Form();
     $form->addText('title', 'title:')->setRequired()->getControlPrototype()->addClass('form-control');
     $form->addText('slug', 'slug:')->setRequired()->getControlPrototype()->addClass('form-control');
     $form->addText('color', 'color:')->setRequired()->getControlPrototype()->addClass('color {minV:0.9} form-control');
     $form->addText('bg_color', 'bg_color:')->setRequired()->getControlPrototype()->addClass('color {maxV:0.5} form-control');
     $form->addCheckbox('active', 'active:')->setRequired()->getControlPrototype()->addClass('form-control');
     $form->addSubmit('send', 'Save tag')->getControlPrototype()->setName('button')->addClass('btn btn-success')->setHtml('<span class="glyphicon glyphicon-ok"></span>');
     $form->onSuccess[] = array($this, 'tagFormSucceeded');
     // setup form rendering
     $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'] = 'div class=col-sm-10';
     $renderer->wrappers['label']['container'] = 'div class="col-sm-2 control-label"';
     $renderer->wrappers['control']['description'] = 'span class=help-block';
     $renderer->wrappers['control']['errorcontainer'] = 'span class=help-block';
     // make form and controls compatible with Twitter Bootstrap
     $form->getElementPrototype()->class('form-horizontal');
     // <form class="form-horizontal">
     foreach ($form->getControls() as $control) {
         if ($control instanceof Controls\Button) {
             $control->getControlPrototype()->addClass(empty($usedPrimary) ? 'btn btn-primary' : 'btn btn-default');
             $usedPrimary = TRUE;
         } elseif ($control instanceof Controls\TextBase || $control instanceof Controls\SelectBox || $control instanceof Controls\MultiSelectBox) {
             $control->getControlPrototype()->addClass('form-control');
         } elseif ($control instanceof Controls\Checkbox || $control instanceof Controls\CheckboxList || $control instanceof Controls\RadioList) {
             $control->getSeparatorPrototype()->setName('div')->addClass($control->getControlPrototype()->type);
         }
     }
     return $form;
 }
  /**
 * 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');
Example #14
0
 protected function createComponentNastenkaForm()
 {
     $form = new Form();
     $form->addText('nadpis', 'Nadpis');
     $form->addTextArea('text', 'Text')->setRequired('Zadejte text příspěvku na nástěnku.');
     $form->addTbDatePicker('platneOd', 'Zobrazit od:', NULL, 12)->setAttribute('class', 'datepicker')->setOption('input-prepend', 'calendar')->setRequired('Zadejte datum od kdy příspěvek zobrazit.')->setFormat(self::$dateFormat);
     $form->addTbDatePicker('platneDo', 'Zobrazit do:', NULL, 12)->setAttribute('class', 'datepicker')->setOption('input-prepend', 'calendar')->setFormat(self::$dateFormat);
     $form->addCheckbox('platnostTrvale', 'Zobrazit trvale?');
     $form->addCheckbox('verejne', 'Veřejné?');
     $form->addSubmit('send', 'Uložit');
     $form->addHidden('id');
     $form->onSuccess[] = array($this, 'nastenkaFormSucceeded');
     $form->onValidate[] = array($this, 'nastenkaFormValidate');
     $form->setRenderer(new BootstrapRenderer());
     return $form;
 }
 protected function createComponentFilters($name)
 {
     $form = new Form($this, $name);
     $form->addText('search', 'Search by')->setDefaultValue($this->getParam('search', ''));
     $form->addCheckbox('activeOnly', 'Active users only')->setDefaultValue($this->getParam('activeOnly'));
     $form->addSubmit('s', 'Filter');
     $form->onSubmit[] = array($this, 'filters_submit');
 }
Example #16
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();
 }
Example #17
0
 /**
  * @return Form
  */
 public function create()
 {
     $form = new Form();
     $form->addPassword('password', 'Heslo:')->setRequired('Please enter your password.');
     $form->addCheckbox('remember', 'Keep me signed in');
     $form->addSubmit('submit', 'Sign in');
     $form->onSuccess[] = array($this, 'formSucceeded');
     return $form;
 }
Example #18
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;
 }
Example #19
0
 protected function createComponentSettingsForm()
 {
     $form = new UI\Form();
     $form->addProtection();
     //Obecné nastavení:
     $form->addCheckbox('disable_blog', 'Zakázat blog jako takový');
     $form->addCheckbox('random_search', 'Povolit random výběr příspěvků');
     $form->addCheckbox('show_content', 'Zobrazit obsah blogu');
     $form->addText('ga_code', 'Google Analytics kód:');
     $form->addText('disqus_shortname', 'Disqus shortname:');
     //Nastavení příspěvků:
     $form->addCheckbox('show_comments', 'Zobrazovat komentáře');
     //$form->addCheckbox('enable1', 'Aktivovat EXTENSION'); //TODO: do vlastního extension config povolování extensions
     $form->defaults = $this->settings->findAllByKeys();
     $form->addSubmit('save', 'Uložit změny');
     $form->onSuccess[] = $this->settingsFormSucceeded;
     return $form;
 }
Example #20
0
 /**
  * @return Form
  */
 public function create()
 {
     $form = new Form();
     $form->addText('nick', 'Jméno/mail:')->setRequired('Zadejte své jméno nebo mail');
     $form->addPassword('password', 'Heslo:')->setRequired('Zadejte své heslo');
     $form->addCheckbox('remember', 'Zůstat přihlášen');
     $form->addSubmit('send', 'Přihlásit');
     $form->onSuccess[] = [$this, 'formSucceeded'];
     return $form;
 }
 /**
  * Creates the sign in form.
  * @return Nette\Application\UI\Form The form
  */
 protected function createComponentSignInForm()
 {
     $form = new Form();
     $form->addText('username')->setRequired();
     $form->addPassword('password')->setRequired();
     $form->addCheckbox('remember');
     $form->addSubmit('submit');
     $form->onSuccess[] = array($this, 'signInFormSucceeded');
     return $form;
 }
Example #22
0
class SignInFormFactory
{
    /** @var Security\User */
    protected $user;
    /** @param Security\User $user   */
    public function __construct(Security\User $user)
    {
        $this->user = $user;
    }
    /**
   * Prihlasovaci formular
Example #23
0
 protected function createComponentSignInForm()
 {
     $form = new Nette\Application\UI\Form();
     $form->addText('username', 'Uživateľské méno:')->setRequired('Prosím, vyplňte svoje užívateľské méno.');
     $form->addPassword('password', 'Heslo:')->setRequired('Prosím, vyplňte svoje heslo.');
     $form->addCheckbox('remember', 'Zostať prihlásený');
     $form->addSubmit('send', 'Prihlásiť');
     $form->onSuccess[] = array($this, 'signInFormSucceeded');
     return $form;
 }
 /**
  * Sign in form component factory.
  * @return Nette\Application\UI\Form
  */
 protected function createComponentSignInForm()
 {
     $form = new UI\Form();
     $form->addText('username', 'Username:'******'Please provide a username.');
     $form->addPassword('password', 'Password:'******'Please provide a password.');
     $form->addCheckbox('remember', 'Remember me on this computer');
     $form->addSubmit('send', 'Sign in');
     $form->onSuccess[] = callback($this, 'signInFormSubmitted');
     return $form;
 }
Example #25
0
 /**
  * Sign-in form factory.
  * @return Nette\Application\UI\Form
  */
 protected function createComponentSignInForm()
 {
     $form = new Form();
     $form->addText('username', 'Uživatelské jméno:', 30, 20);
     $form->addPassword('password', 'Heslo:', 30);
     $form->addCheckbox('persistent', 'Pamatovat si mě na tomto počítači');
     $form->addSubmit('login', 'Přihlásit se');
     $form->onSuccess[] = $this->signInFormSubmitted;
     return $form;
 }
 /**
  * @return Form
  */
 public function create()
 {
     $oForm = new Form();
     $oForm->addText('username', 'Login:'******'Prosím zadejte uživatelské jméno(login).');
     $oForm->addPassword('password', 'Heslo:')->setRequired('Prosím zadejte uživatelské heslo.');
     $oForm->addCheckbox('remember', 'Ponechat mě přihlášeného');
     $oForm->addSubmit('send', 'Přihlásit');
     $oForm->onSuccess[] = array($this, 'formSucceeded');
     return $oForm;
 }
Example #27
0
 /**
  * Sign-in form factory.
  * @return Nette\Application\UI\Form
  */
 protected function createComponentSignInForm()
 {
     $form = new UI\Form();
     $form->addText('username', 'Username:'******'Zadejte prosím uživatelské jméno.');
     $form->addPassword('password', 'Password:'******'Zadejte prosím správné heslo.');
     $form->addCheckbox('remember', 'Zapamatovat si přihlášení');
     $form->addSubmit('send', 'Přihlásit se');
     $form->onSuccess[] = $this->signInFormSucceeded;
     return $form;
 }
 /**
  * @return UI\Form
  */
 public function create()
 {
     $form = new UI\Form();
     $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('submit', 'Sign in');
     $form->onSuccess[] = $this->formSucceeded;
     return $form;
 }
Example #29
0
 protected function createComponentForm()
 {
     $form = new Form();
     $form->addText('email', 'Email')->setRequired('Please fill in %label');
     $form->addPassword('password', 'Password')->setRequired('Please fill in %label');
     $form->addCheckbox('remember', 'Remember me on this computer');
     $form->addSubmit('btnSubmit', 'Sign in');
     $form->onSuccess[] = $this->formSuccess;
     return $form;
 }
Example #30
0
 /**
  * Sign-in form factory.
  * @return Nette\Application\UI\Form
  */
 protected function createComponentSignInForm()
 {
     $form = new Nette\Application\UI\Form();
     $form->addText('username', 'Username:'******'Please enter your username.');
     $form->addPassword('password', 'Password:'******'Please enter your password.');
     $form->addCheckbox('remember', 'Remember me');
     $form->addSubmit('send', 'Sign in');
     $form->onSuccess[] = array($this, 'signInFormSucceeded');
     return $form;
 }