* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */ class SubscriberForm extends BaseSubscriberForm { public function configure() { unset($this['created_at']); unset($this['updated_at']); $this->validatorSchema['email'] = new sfValidatorEmail(); $this->validatorSchema['name']->setOption('required', true); $this->validatorSchema->getPostValidator()->setMessage('invalid', 'Zadaný email už je registrovaný.');; $this->widgetSchema['agree'] = new saWidgetFormInputCheckboxAgree(); $page = Doctrine::getTable('Page')->findOneById(25); if($page) { $this->widgetSchema['agree']->setOption('message', $page->getText()); } $this->validatorSchema['agree'] = new sfValidatorBoolean(array('required' => true)); $this->widgetSchema->setLabels(array( 'name' => 'Meno', 'email' => 'E-mail', 'profile_id' => 'Pripojený profil', 'agree' => 'Podmienky', )); commonFormFunctions::addClasses($this); commonFormFunctions::setJqUiFormater($this); } }