1 theme.inc theme_has_color_support($theme)

Detect if a theme has support for the Color module.

This utility function checks a theme's .info file for whether support for the Color module has been enabled. If the theme has a base theme, it loops through the .info files of the parent themes as well.

@since 1.16.0

Parameters

string $theme: The theme name to be checked for Color module support.

Return value

bool: TRUE if the theme supports Color module, FALSE otherwise.

File

core/includes/theme.inc, line 1532
The theme system, which controls the output of Backdrop.

Code

function theme_has_color_support($theme) {
  $themes = list_themes();
  $theme_info = $themes[$theme];
  if (!empty($theme_info->info['settings']['color']) && file_exists(backdrop_get_path('theme', $theme_info->name) . '/color/color.inc')) {
    return TRUE;
  }
  if (isset($theme_info->info['base theme'])) {
    return theme_has_color_support($theme_info->info['base theme']);
  }
  return FALSE;
}