You are here

function spaces_features_form_validate in Spaces 6.2

Same name and namespace in other branches
  1. 5.2 spaces_admin.inc \spaces_features_form_validate()
  2. 5 spaces_admin.inc \spaces_features_form_validate()
  3. 6 spaces_admin.inc \spaces_features_form_validate()

Validate handler for spaces features form

1 call to spaces_features_form_validate()
spaces_preset_form_validate in ./spaces_admin.inc
Validation for the preset form.

File

./spaces_admin.inc, line 626

Code

function spaces_features_form_validate($form, &$form_state) {
  $space = $form_state['values']['space'];
  $settings = spaces_settings();
  if (is_array($form_state['values']['features'])) {
    if (isset($space->sid) && array_sum($form_state['values']['features']) == 0) {
      return form_set_error('', t('You must enable at least 1 feature for this space.'));
    }
  }
  if (is_array($form_state['values']['settings'])) {
    foreach ($form_state['values']['settings'] as $setting => $value) {
      $settings[$setting]
        ->validate($space, $value);
    }
  }
}