You are here

function block_class_styles_flush_caches in Block Class Styles 7.2

Implements hook_flush_caches().

Scans theme info files for presets and modifies our variable

Related topics

File

./block_class_styles.module, line 231
Base module file for block_class_styles

Code

function block_class_styles_flush_caches() {
  $presets = variable_get('block_class_styles_presets', array());

  // Scan the theme info files
  $include_from_themes = array();
  $info = array();
  foreach (list_themes() as $name => $data) {

    // Check for the parent themes because we'll need to include that info
    if ($data->status && isset($data->base_themes)) {
      $include_from_themes += $data->base_themes;
    }
    if (isset($data->info['block_class_styles'])) {
      $include_from_themes[$name] = $data->info['name'];
      $info[$name] = $data->info['block_class_styles'];
    }
  }
  $info = array_intersect_key($info, $include_from_themes);
  foreach ($info as $array) {
    $presets = array_merge($presets, $array);
  }
  variable_set('block_class_styles_presets', $presets);
}