public function configure() { $this->useFields(array('state', 'filename')); $this->addPagerItems(); $state_list = Imports::getStateList(); /* Widgets */ $this->widgetSchema['state'] = new sfWidgetFormChoice(array('choices' => $state_list)); $this->widgetSchema['filename'] = new sfWidgetFormInputText(); $this->widgetSchema['filename']->setAttributes(array('class' => 'small_size')); /* Labels */ $this->widgetSchema->setLabels(array('filename' => 'Filename', 'state' => 'State')); /* validators */ $this->widgetSchema['show_finished'] = new sfWidgetFormInputCheckbox(); $this->setDefault('show_finished', true); $this->validatorSchema['show_finished'] = new sfValidatorBoolean(array('required' => false)); }
public function configure() { $this->useFields(array('collection_ref', 'state', 'filename')); $this->addPagerItems(); $collection_list = Doctrine::getTable('Collections')->getAllAvailableCollectionsFor($this->options['user']); $state_list = Imports::getStateList(); /* Widgets */ $this->widgetSchema['collection_ref'] = new sfWidgetFormChoice(array('choices' => $collection_list)); $this->widgetSchema['state'] = new sfWidgetFormChoice(array('choices' => $state_list)); $this->widgetSchema['filename'] = new sfWidgetFormInputText(); $this->widgetSchema['filename']->setAttributes(array('class' => 'small_size')); /* Labels */ $this->widgetSchema->setLabels(array('collection_ref' => 'Collections', 'filename' => 'Filename', 'state' => 'State')); /* validators */ $this->validatorSchema['collection_ref'] = new sfValidatorChoice(array('choices' => array_keys($collection_list))); $this->widgetSchema['show_finished'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['show_finished'] = new sfValidatorBoolean(array('required' => false)); }