You are here

function conditional_styles_paths_to_basetheme in Conditional Stylesheets 6

Return paths for the theme and its base themes.

Parameters

$theme: The name of the theme.

Return value

An array of all the theme paths.

1 call to conditional_styles_paths_to_basetheme()
_conditional_styles_theme in ./conditional_styles.theme.inc
When the theme registry is rebuilt, we also build the conditional stylesheets.

File

./conditional_styles.theme.inc, line 17
Allows themes to add conditional stylesheets.

Code

function conditional_styles_paths_to_basetheme($theme) {
  static $theme_paths;
  if (empty($theme_paths[$theme])) {
    $theme_paths[$theme] = array();
    $themes = list_themes();

    // Grab the paths from the base theme.
    if (!empty($themes[$theme]->base_theme)) {
      $theme_paths[$theme] = conditional_styles_paths_to_basetheme($themes[$theme]->base_theme);
    }
    $theme_paths[$theme][$theme] = dirname($themes[$theme]->filename);
  }
  return $theme_paths[$theme];
}