You are here

function ctools_stylizer_cleanup_style in Chaos Tool Suite (ctools) 6

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

Clean up no longer used files.

To prevent excess clutter in the files directory, this should be called whenever a style is going out of use. When being deleted, but also when the palette is being changed.

1 call to ctools_stylizer_cleanup_style()
theme_ctools_stylizer_preview_form in includes/stylizer.inc
Theme the stylizer preview form.

File

includes/stylizer.inc, line 150
Create customized CSS and images from palettes created by user input.

Code

function ctools_stylizer_cleanup_style($plugin, $settings) {
  ctools_include('css');
  $path = ctools_stylizer_get_image_path($plugin, $settings, FALSE);
  if ($path) {
    ctools_stylizer_recursive_delete($path);
  }
  ctools_css_clear(ctools_stylizer_get_css_id($plugin, $settings));
}