protected function createComponentNastenkaForm() { $form = new Form(); $form->addText('nadpis', 'Nadpis'); $form->addTextArea('text', 'Text')->setRequired('Zadejte text příspěvku na nástěnku.'); $form->addTbDatePicker('platneOd', 'Zobrazit od:', NULL, 12)->setAttribute('class', 'datepicker')->setOption('input-prepend', 'calendar')->setRequired('Zadejte datum od kdy příspěvek zobrazit.')->setFormat(self::$dateFormat); $form->addTbDatePicker('platneDo', 'Zobrazit do:', NULL, 12)->setAttribute('class', 'datepicker')->setOption('input-prepend', 'calendar')->setFormat(self::$dateFormat); $form->addCheckbox('platnostTrvale', 'Zobrazit trvale?'); $form->addCheckbox('verejne', 'Veřejné?'); $form->addSubmit('send', 'Uložit'); $form->addHidden('id'); $form->onSuccess[] = array($this, 'nastenkaFormSucceeded'); $form->onValidate[] = array($this, 'nastenkaFormValidate'); $form->setRenderer(new BootstrapRenderer()); return $form; }