public function createComponentUploadForm()
 {
     $form = new \Nette\Application\UI\Form();
     $form->getElementPrototype()->addAttributes(["class" => "dropzone"]);
     $form->addUpload("file", NULL)->setHtmlId("fileUpload");
     $form->onSuccess[] = $this->process;
     return $form;
 }
예제 #2
0
 public function createComponentLoginForm()
 {
     $form = new Nette\Application\UI\Form();
     $renderer = $form->getRenderer();
     $renderer->wrappers['controls']['container'] = 'div class="control-group"';
     $renderer->wrappers['pair']['container'] = NULL;
     $renderer->wrappers['label']['container'] = NULL;
     $renderer->wrappers['control']['container'] = 'div class="controls"';
     $form->setTranslator($this->parent->translator);
     $form->getElementPrototype()->setClass("ajax");
     // ajax
     $form->addText('username', 'Username')->setRequired()->getLabelPrototype()->setClass('control-label');
     $form['username']->getControlPrototype()->setClass(' input-block-level');
     $form->addPassword('password', 'Password')->setRequired()->getLabelPrototype()->setClass('control-label');
     $form['password']->getControlPrototype()->setClass(' input-block-level');
     $form->addSubmit('login', 'Log in')->setAttribute("class", "btn");
     $form->onSuccess[] = callback($this, "login");
     return $form;
 }
예제 #3
0
 public function createComponentForm()
 {
     $form = new \Nette\Application\UI\Form();
     //$form->getElementPrototype()->class('form-horizontal');
     $form->setTranslator($this->parent->translator);
     $form->getElementPrototype()->setClass("ajax");
     $renderer = $form->getRenderer();
     $renderer->wrappers['controls']['container'] = NULL;
     $renderer->wrappers['pair']['container'] = 'div class="control-group"';
     $renderer->wrappers['label']['container'] = NULL;
     $renderer->wrappers['control']['container'] = NULL;
     $form->addTextArea('text', 'Sdělte nám prosím, co je potřeba upravit. Pokud chcete, abychom vám odpověděli, napište do zprávy svůj e-mail:')->setRequired('Text must be filled.')->getControlPrototype()->class('span12');
     $form->addHidden('id');
     $form->addHidden('subject_id');
     $form->addHidden('event_id');
     $form->addText('www')->setAttribute('class', 'hidden')->setDefaultValue('');
     $form->addSubmit('login', 'Send')->setAttribute("class", "btn");
     $form->onSuccess[] = array($this, 'save');
     return $form;
 }
예제 #4
0
 /**
  * Form for adding and editing News
  *
  * @Action('create', 'edit')
  * @Privilege('create', 'edit')
  */
 protected function createComponentEditNewsForm($name)
 {
     $form = new \Nette\Application\UI\Form($this, $name);
     $form->addProtection('Vypršel časový limit, odešlete formulář znovu');
     $form->addHidden('id');
     $form->addSelect('type', 'Typ aktuality:', ['Zpráva' => 'Zpráva'])->setRequired('Musíte vybrat typ aktuality');
     $form->addJDSelect('event_id', 'Vyberte akci:', $form['type'], array($this, "getValuesEventId"));
     $form->addText('heading', 'Nadpis:')->setRequired('Musíte vyplnit nadpis')->setAttribute('size', 60);
     $form->addTextarea('content', 'Text aktuality:')->setRequired('Musíte vyplnit text aktuality')->setAttribute('rows', 5)->setAttribute('cols', 60);
     if ($this->user->isAllowed('Admin:Default:News', 'show')) {
         $form->addCheckbox('show', 'Zobrazit aktualitu')->setDefaultValue(TRUE);
     }
     $form->addSubmit('send', 'Odeslat');
     $form->onSuccess[] = $this->editNewsFormSucceded;
     $form->getElementPrototype()->onsubmit('tinyMCE.triggerSave()');
     return $form;
 }
예제 #5
0
 public function createComponentOrderby()
 {
     $form = new \Nette\Application\UI\Form();
     $form->getElementPrototype()->class('form-inline');
     $form->setTranslator($this->translator);
     $renderer = $form->getRenderer();
     $renderer->wrappers['controls']['container'] = NULL;
     $renderer->wrappers['pair']['container'] = 'div class="control-group"';
     $renderer->wrappers['label']['container'] = NULL;
     $renderer->wrappers['control']['container'] = NULL;
     $form->addSelect('orderby', 'Order by:', array('name' => 'Sort Alpabeticaly', 'created DESC' => 'Recent first', 'recommended' => 'Tips', 'likes' => 'Recommendations'))->setValue($this->order)->setAttribute('onchange', 'submit()');
     $form->onSuccess[] = array($this, 'setOrder');
     return $form;
 }
예제 #6
0
 public function createComponentOrderby()
 {
     $form = new \Nette\Application\UI\Form();
     $form->getElementPrototype()->class('form-inline');
     $form->setTranslator($this->translator);
     $form->addSelect('orderby', 'Order by:', array('date_from' => 'Start date', 'created DESC' => 'Recent first'))->setValue($this->order)->setAttribute('onchange', 'submit()');
     $form->onSuccess[] = array($this, 'setOrder');
     return $form;
 }
예제 #7
0
파일: Grid.php 프로젝트: petak23/echo-msz
 protected function createComponentGridForm()
 {
     $form = new \Nette\Application\UI\Form();
     $form->method = "POST";
     $form->getElementPrototype()->class[] = "grid-gridForm";
     $form->addContainer($this->name);
     $form[$this->name]->addContainer("rowForm");
     $form[$this->name]['rowForm']->addSubmit("send", "Uložiť");
     $form[$this->name]['rowForm']['send']->getControlPrototype()->addClass("grid-editable");
     $form[$this->name]->addContainer("filter");
     $form[$this->name]['filter']->addSubmit("send", "Filtrovať");
     $form[$this->name]->addContainer("action");
     $form[$this->name]['action']->addSelect("action_name", "Označené:");
     $form[$this->name]['action']->addSubmit("send", "Potvrdit")->getControlPrototype()->addData("select", $form[$this->name]["action"]["action_name"]->getControl()->name);
     $form[$this->name]->addContainer('perPage');
     $form[$this->name]['perPage']->addSelect("perPage", "Záznamou na stranu:", $this->perPageValues)->getControlPrototype()->addClass("grid-changeperpage")->addData("gridname", $this->getGridPath())->addData("link", $this->link("changePerPage!"));
     $form[$this->name]['perPage']->addSubmit("send", "Ok")->getControlPrototype()->addClass("grid-perpagesubmit");
     $form->onSuccess[] = [$this, 'processGridForm'];
     return $form;
 }
 public function createComponentEditSongForm()
 {
     $form = new \Nette\Application\UI\Form();
     $form->addHidden('id');
     $form->addText('name', 'Jméno písně:');
     $form->addText('artist', 'Interpret:');
     $form->addSelect('group', 'Skupina:', ['Oddílový' => 'Základní dětský', 'Táborový' => 'Rozšířený dětský', 'Střediskový' => 'Táborákové písně', 'Roverský' => 'Nevhodné pro bobany']);
     $form->addTextarea('lyrics', 'Text:', 50)->setAttribute('class', 'mceEditor');
     $form->addTextarea('notes', 'Poznámky:');
     $form->addSubmit('send', 'Odeslat');
     $form->getElementPrototype()->onsubmit('tinyMCE.triggerSave()');
     $form->onSuccess[] = $this->editSongFormSucceded;
     return $form;
 }