You are here

function spaces_preset_editor_remove_overrides in Spaces 6.3

Same name and namespace in other branches
  1. 7.3 spaces_ui/export_ui/spaces_presets_export_ui.class.php \spaces_preset_editor_remove_overrides()
  2. 7 spaces_ui/export_ui/spaces_presets_export_ui.class.php \spaces_preset_editor_remove_overrides()

Submit handler for removing specific preset overrides.

1 string reference to 'spaces_preset_editor_remove_overrides'
spaces_preset_editor in spaces_ui/export_ui/spaces_presets_export_ui.class.php
Preset editor form.

File

spaces_ui/export_ui/spaces_presets_export_ui.class.php, line 199

Code

function spaces_preset_editor_remove_overrides(&$form, &$form_state) {
  foreach (array_keys(spaces_controllers()) as $controller) {
    if (!empty($form_state['item']->value[$controller])) {
      $remove = !empty($form_state['values']['revert'][$controller]) ? array_filter($form_state['values']['revert'][$controller]) : array();
      $form_state['item']->value[$controller] = array_diff_key($form_state['item']->value[$controller], $remove);
    }
  }
}