You are here

function spaces_customize_form_validate in Spaces 6

Same name and namespace in other branches
  1. 5.2 spaces_admin.inc \spaces_customize_form_validate()
  2. 6.2 spaces_admin.inc \spaces_customize_form_validate()

Validate handler for spaces features form

File

./spaces_admin.inc, line 890

Code

function spaces_customize_form_validate($form_id, &$form_state) {
  $space = $form_state['values']['space'];
  $feature = $form_state['values']['feature'];

  // Push each customizer value through the customizer's validator
  $customizers = spaces_customizers();
  foreach ($customizers as $id => $customizer) {
    $customizer
      ->validate($space, $feature, $form_state['values']['customizers'][$id]);
  }

  // Push each feature setting through the setting's validator
  $features = spaces_features();
  if (isset($features[$feature]->spaces['settings'])) {
    foreach ($features[$feature]->spaces['settings'] as $id => $setting) {
      $setting
        ->validate($space, $form_state['values']['settings'][$id]);
    }
  }
}