protected function createComponentAdminAddForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link("Module" . $this->moduleName . ':Save', array('id' => $this->module->id));
     $form->setAction($url_save);
     $form->addUpload('img', 'Obrázek:')->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.')->addRule(\Nette\Application\UI\Form::FILLED, 'Musíte zadat obrázek.');
     $form->setCustomRenderer();
     return $form;
 }
 protected function createComponentAddImagesForm()
 {
     $form = new \CustomForm();
     $url_save = $this->link('Module' . $this->moduleName . ':SaveImages', array('moduleid' => $this->module->id, 'id' => $this->params['id']));
     $form->setAction($url_save);
     $form->addUpload('img', 'Přidat obrázek:', true)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.')->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat image.');
     $form->addSubmit('create', 'Nahrát');
     $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE);
     $form->setCustomRenderer();
     return $form;
 }
 protected function createComponentEditForm()
 {
     $form = new \CustomForm();
     $form->addUpload('img', 'Obrázek:')->addCondition(\Nette\Application\UI\Form::FILLED)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.');
     $form->addText('title', 'Nadpis', 50, 255);
     $form->addText('subtitle', 'Podtitulek', 50, 255);
     $form->addTextArea('text', 'Text');
     $form->addText('link', 'Odkaz (celá URL adresa)', 50);
     $form->addText('link_text', 'Viditelný text odkazu', 50, 32);
     $form->addSubmit('create', 'Uložit');
     $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE);
     $form->setCustomRenderer();
     $form->onSuccess[] = array($this, 'editFormSucceeded');
     return $form;
 }
Пример #4
0
 protected function createComponentSettings()
 {
     $form = new \CustomForm();
     $form->addUpload('logo', 'Logo')->addCondition(\Nette\Application\UI\Form::FILLED)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.');
     $form->addText('title', 'Titulek stránky', 64);
     $form->addText('description', 'Popis stránky', 256);
     $form->addText('keywords', 'Klíčová slova stránky', 512);
     $form->addText('email', 'Hlavní e-mail', 512);
     $form->addHidden("layout");
     $form->addText('layoutVisible', 'Layout')->setDisabled()->setValue($this->settings["layout"]->getTitle());
     $form->addSubmit('setLayout', 'Vybrat jiný layout')->setAttribute("data-toggle", "modal")->setAttribute("data-target", "#layoutWizard")->setAttribute("type", "button");
     $form->addSubmit('addPage', 'Uložit');
     $defaults = $this->settings;
     $defaults["layout"] = $this->settings["layout"]->getName();
     $form->setDefaults($defaults);
     $form->onSuccess[] = array($this, 'addPageModuleToPageFormSucceeded');
     $form->setCustomRenderer();
     return $form;
 }
 protected function createComponentEditForm()
 {
     $form = new \CustomForm();
     $form->addUpload('img', 'Obrázek:')->addCondition(\Nette\Application\UI\Form::FILLED)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.');
     $form->addText('title', 'Nadpis', 50)->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat nadpis.');
     $form->addText('subtitle', 'Podtitulek', 50);
     $form->addTextArea('text', 'Text')->setAttribute("class", "tinymce_text_editor")->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat text.');
     $form->addText('client', 'Zákazník (jméno, město, ...)', 50);
     $form->addText('link', 'Odkaz (celá URL adresa)', 50);
     $form->addSubmit('create', 'Uložit');
     $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE);
     $form->setCustomRenderer();
     $form->onSuccess[] = array($this, 'editFormSucceeded');
     return $form;
 }
 protected function createComponentImageGaleryForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link('ModuleImageGalery:Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('id')));
     $form->setAction($url_save);
     $form->addUpload('img', 'Obrázek:', true)->addRule(\Nette\Application\UI\Form::IMAGE, 'Soubor musí být JPEG, PNG nebo GIF.')->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat image.');
     $form->addText('description', 'Popis: ', 50);
     $form->addSubmit('create', 'Nahrát');
     $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE);
     $form->setCustomRenderer();
     return $form;
 }