1 color.module | color_get_info($theme) |
Retrieves the Color module information for a particular theme.
File
- core/
modules/ color/ color.module, line 367 - Allows users to change the color scheme of themes.
Code
function color_get_info($theme) {
static $color_info = array();
if (!isset($color_info[$theme])) {
$info = array(); // The variable to be populated by the theme color.inc file.
$path = backdrop_get_path('theme', $theme);
$file = BACKDROP_ROOT . '/' . $path . '/color/color.inc';
if ($path && file_exists($file)) {
include $file;
}
$themes = list_themes();
$theme_info = $themes[$theme];
if (empty($info) || !isset($info['css'])) {
$info['css'] = array();
if (isset($theme_info->stylesheets)) {
foreach ($theme_info->stylesheets as $group) {
$info['css'] = array_merge($info['css'], array_keys($group));
}
}
}
foreach ($info['css'] as $key => $file) {
$info['css'][$key] = backdrop_basename($file);
}
if (isset($theme_info->base_theme) && !empty($theme_info->base_theme)) {
$base_info = color_get_info($theme_info->base_theme);
$info = backdrop_array_merge_deep($info, $base_info);
}
$info['css'] = array_unique($info['css']);
$color_info[$theme] = $info;
}
return $color_info[$theme];
}