* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */ class AdminUserForm extends sfGuardUserForm { public function configure() { parent::configure(); unset($this['permissions_list']); unset($this['groups_list']); unset($this['is_active']); $this->widgetSchema['is_super_admin'] = new sfWidgetFormInputHidden(); $this->widgetSchema['first_name'] = new sfWidgetFormInputText(array('label' => __('Jméno'))); $this->widgetSchema['last_name'] = new sfWidgetFormInputText(array('label' => __('Příjmení'))); $this->validatorSchema['first_name'] = new sfValidatorString(array('max_length' => 255, 'required' => false)); $this->validatorSchema['last_name'] = new sfValidatorString(array('max_length' => 255, 'required' => false)); $this->widgetSchema->moveField('first_name', sfWidgetFormSchema::FIRST); $this->widgetSchema->moveField('last_name', sfWidgetFormSchema::AFTER, 'first_name'); } public function bind(array $taintedValues = null, array $taintedFiles = null) { $taintedValues['is_super_admin'] = true; parent::bind($taintedValues, $taintedFiles); } }