public function filter($values)
 {
     if (empty($values['ftp_password']) && ConfigurationHelper::hasParameter('Backup', 'ftp_password')) {
         $values['ftp_password'] = ConfigurationHelper::getParameter('Backup', 'ftp_password');
     }
     return $values;
 }
 public function configure()
 {
     $this->widgetSchema['allow_registration'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['allow_registration'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('allow_registration', 'Allow registration');
     $this->widgetSchema['registration_granted_message'] = new sfWidgetFormTextarea();
     $this->validatorSchema['registration_granted_message'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema->setLabel('registration_granted_message', 'Registration granted message');
     $this->widgetSchema['subtitle'] = new sfWidgetFormInput();
     $this->validatorSchema['subtitle'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema->setLabel('subtitle', 'Subtitle');
     $this->widgetSchema['auth_ldap_choice'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['auth_ldap_choice'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('auth_ldap_choice', 'Use LDAP authentication');
     $this->widgetSchema['auth_ldap_host'] = new sfWidgetFormInput();
     $this->validatorSchema['auth_ldap_host'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema->setLabel('auth_ldap_host', 'LDAP Host');
     $this->widgetSchema['auth_ldap_domain'] = new sfWidgetFormInput();
     $this->validatorSchema['auth_ldap_domain'] = new sfValidatorString(array('required' => false));
     $this->widgetSchema->setLabel('auth_ldap_domain', 'LDAP Domain name');
     // Enabled by default
     if (!ConfigurationHelper::hasParameter('General', 'allow_registration')) {
         ConfigurationHelper::setParameter('General', 'allow_registration', true);
     }
     // Disabled by default
     if (!ConfigurationHelper::hasParameter('General', 'auth_ldap_choice')) {
         ConfigurationHelper::setParameter('General', 'auth_ldap_choice', false);
     }
     $this->setDefaults(ConfigurationHelper::getNamespace('General'));
     $this->widgetSchema->setNameFormat('generalConfiguration[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
 }
 public function configure()
 {
     $this->widgetSchema['print_reserved_by'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_reserved_by'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_reserved_by', 'Display "Reserved by"');
     if (!ConfigurationHelper::hasParameter('Print', 'print_reserved_by')) {
         ConfigurationHelper::setParameter('Print', 'print_reserved_by', true);
     }
     $this->widgetSchema['print_reserved_for'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_reserved_for'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_reserved_for', 'Display "Reserved for"');
     if (!ConfigurationHelper::hasParameter('Print', 'print_reserved_for')) {
         ConfigurationHelper::setParameter('Print', 'print_reserved_for', true);
     }
     $this->widgetSchema['print_reason'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_reason'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_reason', 'Display "Reason"');
     $this->widgetSchema['print_time'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_time'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_time', 'Display "Time"');
     $this->widgetSchema['print_duration'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_duration'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_duration', 'Display "Duration"');
     $this->widgetSchema['print_custom_field1'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_custom_field1'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_custom_field1', 'Display "Custom field 1"');
     $this->widgetSchema['print_custom_field2'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_custom_field2'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_custom_field2', 'Display "Custom field 2"');
     $this->widgetSchema['print_custom_field3'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_custom_field3'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_custom_field3', 'Display "Custom field 3"');
     $this->widgetSchema['print_status'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_status'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_status', 'Display "Status"');
     $this->widgetSchema['print_profile'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_profile'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_profile', 'Display "Physical access"');
     $this->widgetSchema['print_title'] = new sfWidgetFormInputCheckbox();
     $this->validatorSchema['print_title'] = new sfValidatorBoolean(array('required' => false));
     $this->widgetSchema->setLabel('print_title', 'Display titles');
     $this->setDefaults(ConfigurationHelper::getNamespace('Print'));
     $this->widgetSchema->setNameFormat('printConfiguration[%s]');
     $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
 }