public function configure() { $this->widgetSchema['users_group_id'] = new sfWidgetFormChoice(array('choices' => UsersGroups::getChoicesByType()), array('onChange' => 'set_extra_fields_per_group(this.value)')); $this->widgetSchema['active'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1)); $this->setDefault('active', 1); $this->widgetSchema['notify'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1)); $this->setDefault('notify', 1); $this->setValidator('notify', new sfValidatorString(array('required' => false))); $this->widgetSchema['remove_photo'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1)); $this->setDefault('remove_photo', 0); $this->setValidator('remove_photo', new sfValidatorString(array('required' => false))); $this->widgetSchema['photo'] = new sfWidgetFormInputFile(); $this->widgetSchema['photo_preview'] = new sfWidgetFormInputHidden(); $this->setValidator('photo_preview', new sfValidatorString(array('required' => false))); $this->widgetSchema['name']->setAttributes(array('size' => '40', 'class' => 'required')); $this->widgetSchema['email']->setAttributes(array('size' => '40', 'class' => 'required')); if ($this->getObject()->isNew()) { $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->widgetSchema['password']->setAttributes(array('class' => 'required')); } else { unset($this->widgetSchema['password']); unset($this->validatorSchema['password']); $this->widgetSchema['new_password'] = new sfWidgetFormInputPassword(); $this->setValidator('new_password', new sfValidatorString(array('required' => false))); $this->setDefault('photo_preview', $this->getObject()->getPhoto()); } $this->widgetSchema['culture'] = new sfWidgetFormI18nChoiceLanguage(array('languages' => app::getLanguageCodes())); $this->setDefault('culture', sfConfig::get('sf_default_culture')); $this->widgetSchema->setLabels(array('users_group_id' => 'Group', 'name' => 'Full Name', 'remove_photo' => 'Remove Photo', 'new_password' => 'New Password', 'culture' => 'Language', 'default_home_page' => 'Start Page', 'active' => 'Active?', 'notify' => 'send login details to user')); unset($this->widgetSchema['skin']); unset($this->validatorSchema['skin']); }
</td> <td><?php echo $user->getName() . ' <' . $user->getEmail() . '>'; ?> </td> </tr> <tr> <td><?php echo __('To'); ?> <br><a href="#" onClick="return checkAllInContainer('users_groups_container')"><small><?php echo __('Select All'); ?> </small></a></td> <td><div id="users_groups_container"><?php echo select_tag('users_groups', '', array('choices' => UsersGroups::getChoicesByType(), 'multiple' => true, 'expanded' => true)); ?> </div></td> </tr> <tr> <td><?php echo __('Subject'); ?> </td> <td><?php echo input_tag('subject', $sf_request->getParameter('subject'), array('size' => 60, 'class' => 'required')); ?> </td> </tr> <tr> <td><?php
<th><label for="cfg_app_use_ldap_login"><?php echo __('Use LDAP Login'); ?> </label></th> <td><?php echo select_tag('cfg[app_use_ldap_login]', sfConfig::get('app_use_ldap_login'), array('choices' => $default_selector)); ?> </td> </tr> <tr> <th><label for="cfg_app_ldap_default_user_group"><?php echo __('Default Group'); ?> </label></th> <td><?php echo select_tag('cfg[app_ldap_default_user_group]', sfConfig::get('app_ldap_default_user_group'), array('choices' => UsersGroups::getChoicesByType(false, true))); ?> </td> </tr> <tr> <th><label for="cfg_app_ldap_host"><?php echo __('LDAP server name'); ?> </label></th> <td><?php echo input_tag('cfg[app_ldap_server]', sfConfig::get('app_ldap_server'), array('size' => 40)) . '<br><i>' . __('If using LDAP this is the hostname or IP address of the LDAP server. Alternatively you can specify a URL like ldap://hostname:port/') . '</i>'; ?> </td> </tr> <tr> <th><label for="cfg_app_ldap_port"><?php