Beispiel #1
0
 public function setup()
 {
     $this->setWidgets(array('usuari_id' => new sfWidgetFormInputHidden(), 'app_id' => new sfWidgetFormChoice(array('choices' => AppsPeer::select())), 'nivell_id' => new sfWidgetFormChoice(array('choices' => NivellsPeer::getSelect()))));
     $this->setValidators(array('usuari_id' => new sfValidatorPropelChoice(array('model' => 'Usuaris', 'column' => 'UsuariID', 'required' => false)), 'app_id' => new sfValidatorPropelChoice(array('model' => 'Apps', 'column' => 'app_id', 'required' => false)), 'nivell_id' => new sfValidatorPropelChoice(array('model' => 'Nivells', 'column' => 'idNivells', 'required' => false))));
     $this->widgetSchema->setNameFormat('usuaris_apps[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     parent::setup();
 }
Beispiel #2
0
 public function setup()
 {
     $this->setWidgets(array('idLlistes' => new sfWidgetFormInputHidden(), 'Nom' => new sfWidgetFormInputText(array(), array('style' => 'width:400px')), 'isActiva' => new sfWidgetFormChoice(array('choices' => array(true => 'Sí', false => 'No')))));
     $this->setValidators(array('idLlistes' => new sfValidatorPropelChoice(array('model' => 'Llistes', 'column' => 'idLlistes', 'required' => false)), 'Nom' => new sfValidatorString(), 'isActiva' => new sfValidatorBoolean()));
     $this->widgetSchema->setNameFormat('llistes[%s]');
     $this->widgetSchema->setLabels(array('Nom' => 'Nom: ', 'isActiva' => 'Està activa? '));
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     parent::setup();
 }
 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()
 {
     parent::setup();
 }