/** * Create contact form controler * @return NAppForm */ public function createComponentPopForm() { $id = (int) $this->getParam('id'); $form = new NAppForm(); $form->addTextArea('body', 'Zpráva:', 40, 10)->addRule(NForm::FILLED, 'Vyplňte prosím obsah zprávy.'); $form->addText('contact', 'Kontakt na Vás (e-mail nebo telefon):')->addRule(NForm::FILLED, 'Nezapomeňte prosím uvést na sebe kontakt.'); $form->addImage('popsend', NEnvironment::getVariable('baseUri') . 'layout/img/form-send.jpg', 'Odeslat'); $form->addHidden('id', $id); $form->getElementPrototype()->class('ajax'); $form['body']->getControlPrototype()->class('s100 h140px'); $form['contact']->getControlPrototype()->class('s100'); $form->onSubmit[] = callback($this, 'popFormSubmited'); return $form; }