You are here

function _geshifilter_clear_filter_cache in GeSHi Filter for syntax highlighting 5.2

Same name and namespace in other branches
  1. 6 geshifilter.admin.inc \_geshifilter_clear_filter_cache()
  2. 7 geshifilter.admin.inc \_geshifilter_clear_filter_cache()

Helper function for clearing the appropriate filter cache entries

2 calls to _geshifilter_clear_filter_cache()
geshifilter_admin_general_settings_submit in ./geshifilter.admin.inc
Submit function for admin settings
geshifilter_admin_per_language_settings_submit in ./geshifilter.admin.inc
Submit function for per language settings

File

./geshifilter.admin.inc, line 457

Code

function _geshifilter_clear_filter_cache() {
  $message = FALSE;

  // iterate over input formats
  foreach (filter_formats() as $format => $input_format) {

    // Get the filters in this input format
    $filters = filter_list_format($format);

    // look if GeSHi is enabled in this input format
    if (isset($filters['geshifilter/0'])) {
      cache_clear_all($format . ':', 'cache_filter', TRUE);
      $message = TRUE;
    }
  }

  // show a message that the filter cache was cleared
  if ($message) {
    drupal_set_message(t('GeSHi filter cleared the filter cache for the appropriate input formats.'));
  }
}