You are here

function magic_form_system_theme_settings_submit in Magic 7.2

Submit handler for the theme settings form.

This form will take the theme settings, and for the css and js excludes, create the regex that will be required to remove the css and js files at will. It will then selectively clear the caches for those specific cache items.

1 string reference to 'magic_form_system_theme_settings_submit'
magic_form_system_theme_settings in includes/magic.settings.inc
Implements hook_form_alter()-ish.

File

includes/magic.settings.inc, line 97
Form and utility functions for the theme settings provided by this module.

Code

function magic_form_system_theme_settings_submit($form, &$form_state) {

  // Remove the active tab (vertical tabs) element from the settings array.
  unset($form_state['values']['magic__active_tab']);
  $theme = $form_state['build_info']['args'][0];

  // If the triggering element is the 'export' button, redirect to the export
  // form.
  if ($form_state['triggering_element']['#value'] == t('Save and export configuration')) {
    $form_state['redirect'] = "admin/appearance/settings/{$theme}/export";
  }

  // Clear the cache entries maintained by this module.
  magic_clear_cache($theme);
}