Ejemplo n.º 1
0
 protected function createComponentUpdateImagesForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('menu_id');
     $form->addUpload('the_file', 'dictionary.main.Image');
     $form->addUpload('the_file_2', 'Obrázek (hover)');
     $form->addUpload('the_file_3', 'Aktivní obrázek');
     $form->addUpload('the_file_4', 'Aktivní obrázek (hover)');
     $form->setDefaults(array("menu_id" => $this->presenter->getParameter("id")));
     $form->addSubmit('submitm', 'dictionary.main.Save');
     $form->onSuccess[] = $this->updateImagesFormSucceeded;
     return $form;
 }
Ejemplo n.º 2
0
 /**
  * Form: User fills in e-mail address to send e-mail with a password generator link
  */
 function createComponentChangePortraitForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addUpload("the_file", "Vyberte obrázek (nepovinné)");
     $form->addSubmit('submitm', 'dictionary.main.Insert');
     $form->onSuccess[] = $this->changePortraitFormSucceeded;
     return $form;
 }
Ejemplo n.º 3
0
 function createComponentDropUploadForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->getElementPrototype()->class = "form-horizontal dropzone";
     $form->addUpload("file_upload")->setHtmlId('file_upload');
     $form->onSuccess[] = $this->dropUploadFormSucceeded;
     return $form;
 }
Ejemplo n.º 4
0
 function createComponentUploadForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->getElementPrototype()->class = "form-horizontal dropzone";
     $form->addHidden("pages_id");
     $form->addUpload("file_upload")->setHtmlId('file_upload');
     $form->setDefaults(array("pages_id" => $this->presenter->getParameter('id')));
     $form->onSuccess[] = $this->uploadFormSucceeded;
     return $form;
 }
Ejemplo n.º 5
0
 /**
  * Image Upload
  */
 function createComponentUploadForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $imageTypes = array('image/png', 'image/jpeg', 'image/jpg', 'image/gif');
     $form->addHidden("id");
     $form->addUpload('the_file', 'dictionary.main.InsertImage')->addRule(\Nette\Forms\Form::MIME_TYPE, 'messages.error.invalidTypeOfMessage', $imageTypes);
     $form->addTextarea("description", "dictionary.main.Description")->setAttribute("class", "form-control");
     $form->addSubmit('send', 'dictionary.main.Image');
     $form->setDefaults(array("id" => $this->presenter->getParameter("id")));
     $form->onSuccess[] = $this->uploadFormSucceeded;
     return $form;
 }
Ejemplo n.º 6
0
 /**
  * Settings save
  */
 function createComponentEditForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('path_id');
     $form->addUpload("path", "dictionary.main.Image");
     $form->addSubmit('send', 'dictionary.main.Save');
     $form->onSuccess[] = $this->editSettingsSucceeded;
     return $form;
 }
Ejemplo n.º 7
0
 /**
  * Edit category
  */
 protected function createComponentEditForm()
 {
     $carousel = $this->database->table("carousel")->get($this->presenter->getParameter("id"));
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('carousel_id');
     $form->addText('title', 'dictionary.main.Title');
     $form->addTextArea('description', 'dictionary.main.Description')->setAttribute("class", "form-control")->setAttribute("style", "max-height: 150px;");
     $form->addText('uri', 'dictionary.main.URL');
     $form->addCheckbox("visible", "dictionary.main.Show");
     $form->addUpload('the_file', 'dictionary.main.Icon');
     $form->addSubmit('submitm', 'dictionary.main.Save');
     $arr = array("carousel_id" => $carousel->id, "title" => $carousel->title, "description" => $carousel->description, "visible" => $carousel->visible, "uri" => $carousel->uri);
     $form->setDefaults(array_filter($arr));
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }