You are here

function advagg_mod_admin_settings_form_submit in Advanced CSS/JS Aggregation 7.2

Submit callback, clear out the advagg cache bin.

Related topics

1 string reference to 'advagg_mod_admin_settings_form_submit'
advagg_mod_admin_settings_form in advagg_mod/advagg_mod.admin.inc
Form builder; Configure advagg settings.

File

advagg_mod/advagg_mod.admin.inc, line 686
Admin page callbacks for the advagg bundler module.

Code

function advagg_mod_admin_settings_form_submit($form, &$form_state) {

  // Clear caches.
  advagg_cache_clear_admin_submit();

  // Reset this form to defaults or recommended values; also show what changed.
  advagg_set_admin_form_defaults_recommended($form_state, 'advagg_mod_admin_mode');

  // If file controlled, turn off skip first file turn on admin defer.
  if ($form_state['values']['advagg_mod_css_defer_visibility'] == 3) {
    $form_state['values']['advagg_mod_css_defer_skip_first_file'] = 0;
    $form_state['values']['advagg_mod_css_defer_admin'] = TRUE;
  }

  // If unified_multisite_dir has changed, flush menu router at the end of the
  // request.
  $multisite_dir = rtrim($form_state['values']['advagg_mod_unified_multisite_dir'], '/');
  $dir = rtrim(variable_get('advagg_mod_unified_multisite_dir', ''), '/');
  if ($multisite_dir != $dir) {
    register_shutdown_function('advagg_get_root_files_dir', TRUE);
    register_shutdown_function('menu_rebuild');
  }
  if (empty($form_state['values']['advagg_mod_js_defer_inline_alter']) && !empty($form_state['values']['advagg_mod_js_defer_jquery'])) {
    $form_state['values']['advagg_mod_js_defer_jquery'] = FALSE;
  }
}