예제 #1
0
 protected function createComponentAddForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link("Module" . $this->moduleName . ':Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('id')));
     $form->setAction($url_save);
     $this->setFormItems($form);
     return $form;
 }
 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 createComponentNewsletterForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link('ModuleEmailGatherer:Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('id')));
     $form->setAction($url_save);
     $form->addText('email', 'Email: ', 256)->addRule(Form::EMAIL, 'Nezadali jste platnou e-mailovou adresu.')->setRequired('Zadejte e-mailovou adresu');
     $form->addSubmit('create', 'Přihlásit se k odběru novinek!');
     $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 createComponentSimpleGoogleMapsForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link('ModuleSimpleGoogleMaps:Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('id')));
     $form->setAction($url_save);
     $form->addText('address', 'Změnit adresu: ', 255)->addRule(\Nette\Application\UI\Form::FILLED, 'Je nutné zadat adresu.');
     $form->addSubmit('create', 'Uložit');
     $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE);
     $form->setCustomRenderer();
     return $form;
 }
 protected function createComponentAddForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link('ModulePictograms:Save', array('id' => $this->module->id, 'parent_page_id' => $this->module->page_id));
     $form->setAction($url_save);
     $form->addRadioList('icon', 'Ikonka', $this->icons);
     $form->addTextArea('text', 'Text');
     $form->addText('link', 'Odkaz (celá URL adresa)', 1000);
     $form->addSubmit('create', 'Uložit');
     $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE);
     $form->setCustomRenderer();
     return $form;
 }
 protected function createComponentAkceForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link('ModuleFeaturing:Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('id')));
     $form->setAction($url_save);
     $form->addUpload('img', 'Obrázek:')->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->addTextArea('text', 'Text');
     $form->addText('link', 'Odkaz (celá URL adresa)', 1000);
     $form->addSubmit('create', 'Uložit');
     $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE);
     $form->setCustomRenderer();
     return $form;
 }
 protected function createComponentAdminAddForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link("Module" . $this->moduleName . ':Save', array('id' => $this->module->id, 'parent_page_id' => $this->oParentPresenter->getParameter('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, 'Je nutné zadat obrázek.');
     $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();
     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;
 }
예제 #10
0
 protected function createComponentSettingsForm()
 {
     $form = new \CustomForm();
     $url_save = $this->oParentPresenter->link("Module" . $this->moduleName . ":SaveSettings", array('id' => $this->module->id, 'parent_page_id' => $this->module->page_id));
     $form->setAction($url_save);
     foreach ($this->module->settings as $setting) {
         $form->addText($setting->key, $setting->name)->setDefaultValue($setting->value);
     }
     $form->addSubmit('create', 'Uložit');
     $form->addSubmit('cancel', 'Zrušit')->setValidationScope(FALSE);
     $form->setCustomRenderer();
     return $form;
 }