public function configure() { parent::configure(); unset($this['updated_at'], $this['role'], $this['phone'], $this['theme'], $this['is_public']); $this->widgetSchema['culture'] = new sfWidgetFormPlopI18nChoiceLanguage(array('languages' => sfPlop::get('sf_plop_cultures'), 'default' => $this->getOption('user_culture'), 'culture' => $this->getOption('culture'))); $this->widgetSchema->setHelps(array('password' => null)); $this->validatorSchema['password'] = new sfValidatorString(array('min_length' => 6, 'max_length' => 128)); }
public function configure() { parent::configure(); $this->useFields($this->getUseFields()); $this->widgetSchema->setNameFormat('sfApplySettings[%s]'); $this->widgetSchema->setFormFormatterName('list'); $this->widgetSchema->setLabels(array('fullname' => 'Full Name')); }
public function updateObject($values = null) { $object = parent::updateObject($values); //$object->setUserId($this->userId); $object->setValidate($this->validate); $object->setIsActive(false); // Don't break subclasses! return $object; }
public function updateObject($values = null) { if (is_null($values)) { $values = $this->getValues(); } $object = parent::updateObject($values); $object->setValidate($this->validate); $object->setIsActive(false); // Don't break subclasses! return $object; }
public function configure() { // Remove all widgets we don't want to show unset($this['is_active'], $this['is_super_admin'], $this['updated_at'], $this['groups_list'], $this['permissions_list'], $this['last_login'], $this['created_at'], $this['salt'], $this['algorithm']); parent::configure(); $profileForm = new ProfileForm($this->object->Profile); unset($profileForm['id'], $profileForm['sf_guard_user_id']); $this->embedForm('Profile', $profileForm); //$this->mergForm // Setup proper password validation with confirmation $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password']->setOption('required', true); $this->widgetSchema['password_confirmation'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password_confirmation'] = clone $this->validatorSchema['password']; $this->widgetSchema->moveField('password_confirmation', 'after', 'password'); $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_confirmation', array(), array('invalid' => 'The two passwords must be the same.'))); }
public function configure() { parent::configure(); $this->removeFields(); /* // We're editing the user who is logged in. It is not appropriate // for the user to get to pick somebody else's userid, or change // the validate field which is part of how their account is // verified by email. Also, users cannot change their email // addresses as they are our only verified connection to the user. $this->setWidget( 'username', new sfWidgetFormInput( array(), array( 'maxlength' => 16 ) ) ); $this->widgetSchema->moveField('username', sfWidgetFormSchema::FIRST); //Firstname and lastname $this->setWidget( 'firstname', new sfWidgetFormInputText( array(), array( 'maxlength' => 30 ) ) ); $this->widgetSchema->moveField('firstname', sfWidgetFormSchema::AFTER, 'username'); $this->setWidget( 'lastname', new sfWidgetFormInputText( array(), array( 'maxlength' => 70 ) ) ); $this->widgetSchema->moveField('lastname', sfWidgetFormSchema::AFTER, 'firstname'); $this->widgetSchema->setLabels( array( 'username' => 'Username', 'firstname' => 'First Name', 'lastname' => 'Last name' ) ); $this->setValidator( 'firstname' , new sfValidatorApplyFirstname(array('required' => false), array('message' => 'fdsaddfas')) ); $this->setValidator( 'lastname', new sfValidatorApplyLastname() ); $this->setValidator( 'username', new sfValidatorSpreadlyUsername() ); */ $this->setValidators(array('first_name' => new sfValidatorApplyFirstname(array('required' => true), array('required' => 'firstname required')), 'last_name' => new sfValidatorApplyLastname(array('required' => true), array('required' => 'firstname required')), 'username' => new sfValidatorSpreadlyUsername(array('required' => true), array('required' => 'firstname required')))); $this->widgetSchema->setNameFormat('sfApplySettings[%s]'); $this->widgetSchema->setFormFormatterName('table'); }
protected function setupInheritance() { parent::setupInheritance(); $this->widgetSchema->setNameFormat('sf_moo_doo_user[%s]'); }
public function configure() { parent::configure(); $this->setDefault('phone', '+7'); $this->useFields(array('first_name', 'last_name', 'email_address', 'icq', 'jabber', 'phone')); }
public function configure() { parent::configure(); $this->useFields(array('first_name', 'last_name', 'email_address', 'api_key')); }
public function configure() { parent::configure(); $this->useFields(array('list_max_per_page')); }
public function configure() { parent::configure(); unset($this['groups_list'], $this['permissions_list'], $this['is_active'], $this['is_super_admin'], $this['username']); }
protected function setupInheritance() { parent::setupInheritance(); $this->widgetSchema->setNameFormat('discipulo[%s]'); }
public function configure() { parent::configure(); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('plopAdmin'); $this->widgetSchema->getFormFormatter()->setHelpFormat(sfPlop::get('sf_plop_form_help_format')); }