/**
  * Edit user data
  */
 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';
     $user = $this->database->table("users")->get($this->presenter->getParameter("id"));
     $form->addHidden('id');
     $form->addRadioList("sex", "Pohlaví", array(1 => ' žena', 2 => ' muž'));
     $form->addRadioList("newsletter", "Odebírat newsletter", array(1 => ' ano', 2 => ' ne'));
     $form->addRadioList("state", "Stav účtu", array(1 => ' povolen', 2 => ' blokován'));
     $roles = $this->database->table("users_roles")->fetchPairs("id", "title");
     if ($this->template->member->username == 'admin') {
         $form->addSelect("role", "Role", $roles)->setAttribute("class", "form-control");
     }
     if ($this->presenter->template->settings['members:groups:enabled']) {
         $groups = $this->database->table("categories")->where("parent_id", $this->presenter->template->settings['members:group:categoryId'])->fetchPairs("id", "title");
         $form->addSelect("group", "Skupina", $groups)->setAttribute("class", "form-control");
     }
     $arr = array("id" => $this->presenter->getParameter("id"), "sex" => $user->sex, "newsletter" => $user->newsletter, "state" => $user->state, "role" => $user->role, "group" => $user->categories_id);
     $form->setDefaults(array_filter($arr));
     $form->addSubmit('submitm', 'dictionary.main.Save')->setAttribute("class", "btn btn-primary");
     $form->onSuccess[] = $this->editFormSucceeded;
     $form->onValidate[] = $this->editFormValidated;
     return $form;
 }
 /**
  * Edit event
  */
 function createComponentEditEventForm()
 {
     $page = $this->database->table("pages")->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('id');
     $form->addHidden('event_id');
     $form->addText('date_event', 'dictionary.main.DateEventStarted')->setAttribute("class", "form-control datepicker")->setAttribute("style", "width: 110px; display: inline;")->setHtmlId("event_start");
     $form->addSelect("hour_event")->setAttribute("class", "form-control text-right")->setAttribute("style", "width: 80px; display: inline;")->setHtmlId("event_hour")->setTranslator(null);
     $form->addSelect("minute_event")->setAttribute("class", "form-control text-right")->setAttribute("style", "width: 80px; display: inline;")->setHtmlId("event_minute")->setTranslator(null);
     $form->addText('date_event_end', 'dictionary.main.DateEventEnded')->setAttribute("class", "form-control datepicker")->setAttribute("style", "width: 110px; display: inline;")->setHtmlId("event_end_date");
     $form->addSelect("hour_event_end")->setAttribute("class", "form-control text-right")->setAttribute("style", "width: 80px; display: inline;")->setHtmlId("event_end_hour")->setTranslator(null);
     $form->addSelect("minute_event_end")->setAttribute("class", "form-control text-right")->setAttribute("style", "width: 80px; display: inline;")->setHtmlId("event_end_minute")->setTranslator(null);
     $form->addText('price', 'dictionary.main.Price')->setAttribute("class", "form-control");
     $form->addText('contact', 'dictionary.main.Place')->setAttribute("class", "form-control");
     $form->addText('time_range', 'Rozsah')->setAttribute("class", "form-control");
     $form->addCheckbox("allday", "dictionary.main.AllDayEvent");
     $form->addText('capacity', 'Kapacita')->setAttribute("class", "form-control");
     $form->addText('capacity_start', 'Kapacita (přidat)')->setAttribute("class", "form-control");
     $form->addSubmit('submitm', 'dictionary.main.Save')->setAttribute("class", "btn btn-success btn");
     $form->setDefaults(array("id" => $page->id));
     $form->onSuccess[] = $this->editEventFormSucceeded;
     return $form;
 }
 /**
  * Insert event
  */
 function createComponentInsertEventForm()
 {
     $hours = array("00" => "00", "01" => "01", "02" => "02", "03" => "03", "04" => "04", "05" => "05", "06" => "06", "07" => "07", "08" => "08", "09" => "09", "10" => "10", "11" => "11", "12" => "12", "13" => "13", "14" => "14", "15" => "15", "16" => "16", "17" => "17", "18" => "18", "19" => "19", "20" => "20", "21" => "21", "22" => "22", "23" => "23");
     $minutes = array("00" => "00", "05" => "05", "10" => "10", "15" => "15", "20" => "20", "25" => "25", "30" => "30", "40" => "40", "45" => "45", "50" => "50", "55" => "55");
     $contacts = $this->database->table("contacts")->where("categories_id", 22)->fetchPairs('id', 'company');
     $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('id');
     $form->addHidden('event_id');
     $form->addText('date_event', 'dictionary.main.DateEventStarted')->setAttribute("class", "form-control datepicker")->setHtmlId("event_start");
     $form->addSelect("hour_event", "", $hours)->setAttribute("class", "form-control text-right")->setHtmlId("event_hour")->setTranslator(null);
     $form->addSelect("minute_event", "", $minutes)->setAttribute("class", "form-control text-right")->setHtmlId("event_minute")->setTranslator(null);
     $form->addText('date_event_end', 'dictionary.main.DateEventEnded')->setAttribute("class", "form-control datepicker")->setHtmlId("event_end_date");
     $form->addSelect("hour_event_end", "", $hours)->setAttribute("class", "form-control text-right")->setHtmlId("event_end_hour")->setTranslator(null);
     $form->addSelect("minute_event_end", "", $minutes)->setAttribute("class", "form-control text-right")->setHtmlId("event_end_minute")->setTranslator(null);
     $form->addText('price', 'dictionary.main.Price')->setAttribute("class", "form-control");
     $form->addSelect('contact', 'dictionary.main.Place', $contacts)->setAttribute("class", "form-control");
     $form->addText('time_range', 'Rozsah')->setAttribute("class", "form-control");
     $form->addText('capacity', 'Kapacita')->setAttribute("class", "form-control");
     $form->addText('capacity_start', 'Kapacita (přidat)')->setAttribute("class", "form-control");
     $form->addCheckbox("allday", "dictionary.main.AllDayEvent");
     $form->setDefaults(array("event_id" => $this->presenter->getParameter("id"), "capacity_start" => 0));
     $form->addSubmit('submitm', 'dictionary.main.Save')->setAttribute("class", "btn btn-success btn");
     $form->onSuccess[] = $this->insertEventFormSucceeded;
     return $form;
 }
Exemple #4
0
 public function createUI()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     return $form;
 }
 /**
  * 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;
 }
 function createComponentChangeForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->addSelect("language", "Jazyk", array("cs" => "česky", "en" => "English"))->setAttribute("class", "form-control");
     $form->setDefaults(array("language" => $this->presenter->translator->getLocale()));
     $form->addSubmit('submitm', 'dictionary.main.Change')->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->changeFormSucceeded;
     return $form;
 }
 /**
  * Form: User fills in e-mail address to send e-mail with a password generator link
  * @return string
  */
 function createComponentSendForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("layer");
     $form->addText("email", "dictionary.main.Email");
     $form->addSubmit('submitm', 'dictionary.main.Send');
     $form->onSuccess[] = $this->sendFormSucceeded;
     return $form;
 }
 function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addText('title', 'dictionary.main.Title');
     $form->addSubmit('submitm', 'dictionary.main.Insert');
     $form->onSuccess[] = $this->insertFormSucceeded;
     return $form;
 }
 /**
  * Newsletter
  * @return \Nette\Forms\BootstrapUIForm
  */
 function createComponentAdd()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "";
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addText("email")->setAttribute("class", "form-control");
     $form->addSubmit("submitm", "messages.helpdesk.send")->setAttribute("class", "btn btn-yellow");
     $form->onValidate[] = $this->addValidated;
     $form->onSuccess[] = $this->addSucceeded;
     return $form;
 }
 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;
 }
 /**
  * Form: User fills in e-mail address to send e-mail with a password generator link
  * @return string
  */
 function createComponentChangePasswordForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addPassword("password1", "dictionary.main.Password");
     $form->addPassword("password2", "Znovu napište heslo");
     $form->addSubmit('name', 'dictionary.main.Change');
     $form->onSuccess[] = $this->changePasswordFormSucceeded;
     return $form;
 }
 /**
  * Send teste-mail
  */
 function createComponentSendForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->addHidden("id");
     $form->addText("email", "E-mail");
     $form->addSubmit('submitm', 'dictionary.main.Save');
     $form->setDefaults(array("id" => $this->presenter->getParameter("id")));
     $form->onSuccess[] = $this->sendFormSucceeded;
     return $form;
 }
 protected function createComponentSignInForm()
 {
     $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("type");
     $form->addText("username", 'dictionary.main.User')->setRequired('Vložte uživatelské jméno.');
     $form->addPassword("password", 'dictionary.main.Password')->setRequired('Vložte heslo.');
     $form->addSubmit("send", 'dictionary.main.login')->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->signInFormSucceeded;
     return $form;
 }
 function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addText("language", "Jazyk");
     $form->addText("code", "Kód");
     $form->addSubmit('send', 'dictionary.main.Save')->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->insertFormSucceeded;
     $form->onValidate[] = $this->permissionValidated;
     return $form;
 }
 function createComponentInsertForm()
 {
     $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("id");
     $form->addText("title", "dictionary.main.Title")->setRequired($this->presenter->translator->translate('messages.pages.NameThePage'));
     $form->setDefaults(array("section" => $this->presenter->getParameter('id')));
     $form->addSubmit("submit", "dictionary.main.Create")->setHtmlId('formxins');
     $form->onSuccess[] = $this->insertFormSucceeded;
     return $form;
 }
 /**
  * Send member login information
  */
 function createComponentSendLoginForm()
 {
     $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("contact_id");
     $form->addCheckbox("sendmail", " " . "Odeslat e-mail s přihlašovacími informacemi")->setValue(0);
     $form->setDefaults(array("contact_id" => $this->presenter->getParameter('id')));
     $form->addSubmit('submitm', 'Zaslat uživateli')->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->sendLoginFormSucceeded;
     return $form;
 }
 /**
  * Insert category
  */
 protected function createComponentInsertForm()
 {
     $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("parent");
     $form->addText('title', 'dictionary.main.Title')->setAttribute("class", "form-control");
     $form->addSubmit('submitm', 'dictionary.main.Insert')->setAttribute("class", "btn btn-primary");
     $form->onSuccess[] = $this->insertFormSucceeded;
     $form->onValidate[] = $this->validateFormSucceeded;
     return $form;
 }
 protected function createComponentFilterForm()
 {
     $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('id');
     $form->addText('src', 'dictionary.main.Title');
     $form->addSubmit('submitm', 'dictionary.main.Search');
     $form->setDefaults(array("id" => $this->getParameter("id")));
     $form->onSuccess[] = $this->filterFormSucceeded;
     return $form;
 }
 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;
 }
 /**
  * Form: Resets passwords in database, user fill in new password
  */
 public function createComponentResetForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("email");
     $form->addHidden("code");
     $form->addPassword("password", "Nové heslo");
     $form->addPassword("password2", "Zopakujte nové heslo");
     $form->addSubmit('name', 'dictionary.main.Change');
     $form->setDefaults(array("email" => $this->presenter->getParameter("email"), "code" => $this->presenter->getParameter("code")));
     $form->onSuccess[] = $this->resetFormSucceeded;
     return $form;
 }
Exemple #21
0
 /**
  * Edit your profile
  */
 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->addGroup("Osobní údaje");
     $form->addText("username", "Uživatel")->setAttribute("style", "border: 0; font-size: 1.5em;")->setDisabled();
     $form->addRadioList('sex', 'Pohlaví', array(1 => " " . 'žena', 2 => " " . 'muž'))->setAttribute("class", "checkboxlistChoose");
     $form->setDefaults(array("username" => $this->presenter->template->member->username, "sex" => $this->presenter->template->member->sex));
     $form->addSubmit("submit", "dictionary.main.Save");
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
Exemple #22
0
 /**
  * Edit by user
  */
 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';
     $members = $this->database->table("users")->get($this->presenter->user->getId());
     $cols = array("username" => $members->username, "email" => $members->email, "name" => $members->name);
     $form->addGroup("Základní nastavení");
     $form->addText("name", "Name");
     $form->setDefaults(array("name" => $cols["name"]));
     $form->addSubmit("submit", "dictionary.main.Save");
     $form->onSuccess[] = array($this, 'editFormSucceeded');
     return $form;
 }
 /**
  * Edit file information
  */
 function createComponentEditForm()
 {
     $image = $this->database->table("media")->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('id');
     $form->addText('title', 'dictionary.main.Title');
     $form->addTextarea('description', "dictionary.main.Description")->setAttribute("style", "height: 200px;")->setAttribute("class", "form-control");
     $form->setDefaults(array("id" => $image->id, "title" => $image->title, "description" => $image->description));
     $form->addSubmit('send', 'dictionary.main.Save');
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
 /**
  * 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;
 }
 /**
  * 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;
 }
 /**
  * Insert communication
  */
 function createComponentInsertForm()
 {
     $types = array("E-mail" => "E-mail", "Telefon, domácí" => "Telefon, domácí", "Telefon, pracovní" => "Telefon, pracovní", "Fax" => "Fax", "Webová adresa" => "Webová adresa", "Skype" => "Skype");
     $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("id");
     $form->addSelect('type', 'Typ komunikace', $types)->setAttribute('class', 'form-control');
     $form->addText('type_value', 'Hodnota');
     $form->addSubmit("submitm", "dictionary.main.Insert")->setAttribute("class", "btn btn-success");
     $form->setDefaults(array("id" => $this->presenter->getParameter('id')));
     $form->onSuccess[] = $this->insertFormSucceeded;
     return $form;
 }
 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;
 }
 /**
  * Edit contact
  */
 function createComponentLoadForm()
 {
     $this->template->id = $this->presenter->getParameter('id');
     $contact = $this->database->table("contacts")->where("pages_id", $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('contact_id');
     $form->addHidden('pages_id');
     $form->addText("vatin", "Načíst IČ")->setAttribute("placeholder", "dictionary.main.VatIn")->setOption("description", 1);
     $form->setDefaults(array("contact_id" => $contact->fetch()->id, "pages_id" => $this->presenter->getParameter("id")));
     $form->addSubmit("submitm", "Načíst")->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->loadVatFormSucceeded;
     return $form;
 }
 /**
  * Edit helpdesk
  */
 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->addHidden("helpdesk_id");
     $form->addText("title", "dictionary.main.Title");
     $form->addTextarea("description", "dictionary.main.Description")->setAttribute("class", "form-control")->setAttribute("style", "height: 200px;");
     $form->addCheckbox("fill_phone");
     $helpdesk = $this->database->table("helpdesk")->get($this->presenter->getParameter("id"));
     $form->setDefaults(array("helpdesk_id" => $helpdesk->id, "title" => $helpdesk->title, "description" => $helpdesk->description, "fill_phone" => $helpdesk->fill_phone));
     $form->addSubmit("submitm", "dictionary.main.Save");
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
 /**
  * Image Upload
  */
 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';
     $imageTypes = array('image/png', 'image/jpeg', 'image/jpg', 'image/gif');
     $image = $this->database->table("media")->get($this->presenter->getParameter("name"));
     $form->addHidden("id");
     $form->addHidden("name");
     $form->addTextarea("description", "dictionary.main.Description")->setAttribute("class", "form-control");
     $form->addSubmit('send', 'dictionary.main.Insert');
     $form->setDefaults(array("id" => $this->presenter->getParameter("id"), "name" => $this->presenter->getParameter("name"), "description" => $image->description));
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }