You are here

function advagg_admin_flush_cache_button in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 7.2 advagg.admin.inc \advagg_admin_flush_cache_button()
  2. 7 includes/admin.inc \advagg_admin_flush_cache_button()

Cache clear button.

2 calls to advagg_admin_flush_cache_button()
advagg_admin_flush_cache in ./advagg.admin.inc
Cache clear callback for admin_menu/flush-cache/advagg.
advagg_admin_settings_form_submit in ./advagg.admin.inc
Validate form values. Used to unset variables before they get saved.
1 string reference to 'advagg_admin_flush_cache_button'
advagg_admin_settings_form in ./advagg.admin.inc
Form builder; Configure advagg settings.

File

./advagg.admin.inc, line 544
Admin page callbacks for the advanced CSS/JS aggregation module.

Code

function advagg_admin_flush_cache_button() {
  global $_advagg;
  _drupal_flush_css_js();
  $cache_tables = advagg_flush_caches();
  foreach ($cache_tables as $table) {
    cache_clear_all('*', $table, TRUE);
  }
  if (empty($_advagg['files'])) {
    drupal_set_message(t('Advanced CSS/JS Aggregation cache scanned and no out of date bundles detected.'));
  }
  else {
    if (empty($_advagg['rebuilt'])) {
      drupal_set_message(t('Advanced CSS/JS Aggregation cache scanned and out of date bundles have been marked. <br />Old Files: <br />!files <br />Marked Bundles Count: %count', array(
        '!files' => nl2br(filter_xss(implode("\n", $_advagg['files']))),
        '%count' => count($_advagg['bundles']),
      )));
    }
    else {
      drupal_set_message(t('Advanced CSS/JS Aggregation cache scanned and out of date bundles have been incremented and rebuilt. <br />Old Files: <br />%files <br />%count done.', array(
        '%files' => implode('<br />', $_advagg['files']),
        '%count' => count($_advagg['rebuilt']),
      )));
    }
  }
}