public function setup()
 {
     $this->setWidgets(array('idNodes' => new sfWidgetFormInputHidden(), 'idPare' => new sfWidgetFormChoice(array('choices' => NodesPeer::selectNodesPares($this->getOption('IDS'))), array()), 'TitolMenu' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Nivell' => new sfWidgetFormChoice(array('choices' => array(0 => 'Fora de menú', 1 => 'Principal', 2 => 'Secundari', 3 => 'Terciari'))), 'Ordre' => new sfWidgetFormChoice(array('choices' => NodesPeer::selectOrdre($this->getOption('IDS'), $this->isNew()))), 'isCategoria' => new sfWidgetFormChoice(array('choices' => array(1 => 'Sí', 0 => 'No')), array()), 'isPhp' => new sfWidgetFormInputHidden(), 'isActiva' => new sfWidgetFormChoice(array('choices' => array(1 => 'Sí', 0 => 'No')), array()), 'HTML' => new sfWidgetFormInputHidden(), 'Url' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'Categories' => new sfWidgetFormChoice(array('choices' => ActivitatsPeer::selectCategoriaActivitat($this->getOption('IDS'), true)), array())));
     $this->setValidators(array('idNodes' => new sfValidatorPropelChoice(array('model' => 'Nodes', 'column' => 'idNodes', 'required' => false)), 'idPare' => new sfValidatorPropelChoice(array('model' => 'Nodes', 'column' => 'idNodes', 'required' => false)), 'TitolMenu' => new sfValidatorString(array('required' => false)), 'HTML' => new sfValidatorString(array('required' => false)), 'isCategoria' => new sfValidatorBoolean(), 'isPhp' => new sfValidatorPass(), 'isActiva' => new sfValidatorBoolean(), 'Ordre' => new sfValidatorInteger(array('required' => false)), 'Nivell' => new sfValidatorInteger(), 'Url' => new sfValidatorString(array('required' => false)), 'Categories' => new sfValidatorString(array('required' => false))));
     $this->widgetSchema->setDefaults(array('TitolMenu' => 'Entreu el títol...', 'Nivell' => '1', 'Ordre' => '1', 'isCategoria' => false, 'isActiva' => true, 'Url' => "", 'Categories' => "Tipus"));
     $this->widgetSchema->setLabels(array('TitolMenu' => 'Títol', 'Nivell' => 'Nivell', 'Ordre' => 'Ordre', 'isCategoria' => 'És només títol?', 'isActiva' => 'Visible?', 'URL' => 'Adreça?'));
     $this->widgetSchema->setNameFormat('nodes[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     parent::setup();
 }
 public function setup()
 {
     $this->WEB_IMATGE = 'images/activitats/';
     $this->WEB_PDF = 'images/activitats/';
     $this->setWidgets(array('ActivitatID' => new sfWidgetFormInputHidden(), 'Cicles_CicleID' => new sfWidgetFormInputHidden(), 'TipusActivitat_idTipusActivitat' => new sfWidgetFormInputHidden(), 'Nom' => new sfWidgetFormInputHidden(), 'Preu' => new sfWidgetFormInputHidden(), 'PreuReduit' => new sfWidgetFormInputHidden(), 'Publicable' => new sfWidgetFormInputHidden(), 'Estat' => new sfWidgetFormInputHidden(), 'Descripcio' => new sfWidgetFormInputHidden(), 'PublicaWEB' => new sfWidgetFormChoice(array('choices' => array(2 => 'No', 1 => 'Sí'))), 'tMig' => new sfWidgetFormInputText(array(), array('style' => 'width:300px')), 'dMig' => new sfWidgetFormTextareaTinyMCE(), 'tComplet' => new sfWidgetFormInputText(array(), array('style' => 'width:300px')), 'dComplet' => new sfWidgetFormTextareaTinyMCE(), 'InfoPractica' => new sfWidgetFormTextareaTinyMCE(), 'Categories' => new sfWidgetFormChoice(array('renderer_class' => 'sfWidgetFormSelectManyMy', 'choices' => ActivitatsPeer::selectCategoriaActivitat($this->getOption('IDS')), 'multiple' => true, 'expanded' => true), array('class' => 'ul_cat'))));
     $this->setValidators(array('ActivitatID' => new sfValidatorPropelChoice(array('model' => 'Activitats', 'column' => 'ActivitatID', 'required' => false)), 'Cicles_CicleID' => new sfValidatorPropelChoice(array('model' => 'Cicles', 'column' => 'CicleID', 'required' => false)), 'TipusActivitat_idTipusActivitat' => new sfValidatorPropelChoice(array('model' => 'Tipusactivitat', 'column' => 'idTipusActivitat', 'required' => false)), 'Nom' => new sfValidatorString(array('required' => false)), 'Preu' => new sfValidatorNumber(array('required' => false)), 'PreuReduit' => new sfValidatorNumber(array('required' => false)), 'Publicable' => new sfValidatorInteger(array('required' => false)), 'Estat' => new sfValidatorString(array('max_length' => 1, 'required' => false)), 'Descripcio' => new sfValidatorString(array('required' => false)), 'Imatge' => new sfValidatorFile(array('path' => $this->WEB_IMATGE, 'required' => false)), 'PDF' => new sfValidatorFile(array('path' => $this->WEB_PDF, 'required' => false)), 'PublicaWEB' => new sfValidatorInteger(array('required' => false)), 'tCurt' => new sfValidatorString(array('required' => false)), 'dCurt' => new sfValidatorString(array('required' => false)), 'tMig' => new sfValidatorString(array('required' => false)), 'dMig' => new sfValidatorString(array('required' => false)), 'tComplet' => new sfValidatorString(array('required' => false)), 'dComplet' => new sfValidatorString(array('required' => false)), 'tipusEnviament' => new sfValidatorChoice(array('required' => false, 'choices' => ActivitatsPeer::getTipusEnviamentsSelectValidator())), 'Categories' => new sfValidatorString(array('required' => false)), 'InfoPractica' => new sfValidatorString(array('required' => false))));
     $this->widgetSchema->setLabels(array('Descripcio' => 'Descripció: ', 'PublicaWEB' => 'Publicar web? ', 'tMig' => 'Títol mig:', 'dMig' => 'Text mig: <div class="textExplicacio">Consulta activitat, Notícies, Facebook, Mitjans</div> ', 'tComplet' => 'Títol complet: ', 'dComplet' => 'Text complet: <div class="textExplicacio">Cursos, és intern</div>', 'Categories' => 'Categories: ', 'InfoPractica' => 'Informació pràctica (web)'));
     $this->widgetSchema->setNameFormat('activitats[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     $this->widgetSchema->setFormFormatterName('Span');
 }