You are here

function spaces_overrides_revert in Spaces 7.3

Same name and namespace in other branches
  1. 6.3 spaces.admin.inc \spaces_overrides_revert()
  2. 7 spaces.admin.inc \spaces_overrides_revert()

Submit handler for reverting overrides.

1 string reference to 'spaces_overrides_revert'
spaces_overrides_form in ./spaces.admin.inc
Form for managing space override values.

File

./spaces.admin.inc, line 229

Code

function spaces_overrides_revert(&$form, &$form_state) {
  $space = $form_state['values']['space'];
  foreach (array_keys(spaces_controllers()) as $controller) {
    $remove = !empty($form_state['values'][$controller]) ? array_filter($form_state['values'][$controller]) : array();
    foreach (array_keys($remove) as $key) {
      $space->controllers->{$controller}
        ->del($key);
    }
  }
  drupal_set_message(t('Saved %title.', array(
    '%title' => $space
      ->title(),
  )));
}