You are here

function spaces_features_form_submit in Spaces 5.2

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

Submit handler for spaces features form

File

./spaces_admin.inc, line 620

Code

function spaces_features_form_submit($form_id, $form_values) {

  // Retrieve the space object from the form
  $space = $form_values['space'];

  // Set feature values
  foreach ($form_values['features'] as $feature => $value) {
    $space->features[$feature] = $value;
  }

  // Set setting values
  $settings = spaces_settings();
  foreach ($form_values['settings'] as $setting => $value) {
    $space->settings[$setting] = $settings[$setting]
      ->submit($space, $value);
  }

  // Save the space
  spaces_save($space);
  drupal_set_message(t('The space configuration has been saved successfully.'));
}