You are here

function advagg_admin_flush_cache_button in Advanced CSS/JS Aggregation 7

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

Cache clear button.

2 calls to advagg_admin_flush_cache_button()
advagg_admin_flush_cache in includes/admin.inc
Cache clear callback for admin_menu/flush-cache/advagg.
advagg_admin_settings_form_submit in includes/admin.inc
Validate form values. Used to unset variables before they get saved.

File

includes/admin.inc, line 569
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']),
      )));
    }
  }
}