You are here

function spaces_customize_form_submit in Spaces 5.2

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

Submit handler for feature customization form.

File

./spaces_admin.inc, line 786

Code

function spaces_customize_form_submit($form_id, $form_values) {
  $space = $form_values['space'];
  $feature = $form_values['feature'];
  $customizers = spaces_customizers();
  switch (trim($form_values['op'])) {
    case t('Save settings'):
      $feature_customizer = array();
      foreach ($customizers as $id => $customizer) {
        $feature_customizer[$id] = $customizer
          ->submit($space, $feature, $form_values[$id]);
      }
      $space->customizer[$feature] = $feature_customizer;
      spaces_save($space);
      drupal_set_message(t('Customizations saved for space !title.', array(
        '!title' => $space->title,
      )));
      break;
    case t('Reset to defaults'):
      unset($space->customizer[$feature]);
      spaces_save($space);
      break;
  }
}