You are here

function spaces_customize_form_validate in Spaces 6.2

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

Validate handler for spaces features form

File

./spaces_admin.inc, line 758

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
  $settings = spaces_feature_settings($feature);
  if (!empty($settings)) {
    foreach ($settings as $id => $setting) {
      $setting
        ->validate($space, $form_state['values']['settings'][$id]);
    }
  }
}