You are here

function ctools_css_clear in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/css.inc \ctools_css_clear()

Remove stored CSS and any associated file.

1 call to ctools_css_clear()
ctools_stylizer_cleanup_style in includes/stylizer.inc
Clean up no longer used files.

File

includes/css.inc, line 108

Code

function ctools_css_clear($id) {
  $cache = db_fetch_object(db_query("SELECT * FROM {ctools_css_cache} WHERE cid = '%s'", $id));
  if (!$cache) {
    return;
  }
  if (file_exists($cache->filename)) {
    file_delete($cache->filename);

    // If we remove an existing file, there may be cached pages that refer
    // to it. We must get rid of them:
    cache_clear_all();
  }
  db_query("DELETE FROM {ctools_css_cache} WHERE cid = '%s'", $id);
}