You are here

function styleswitcher_theme_default_style_key in Style Switcher 6.2

Same name and namespace in other branches
  1. 8.2 styleswitcher.module \styleswitcher_theme_default_style_key()
  2. 7.2 styleswitcher.module \styleswitcher_theme_default_style_key()
  3. 3.0.x styleswitcher.module \styleswitcher_theme_default_style_key()

Saves/returns the key of default style provided by a theme.

When theme's .info file is scanned for styles to switch this function is called with argument to statically save a style key for further use. And after, when this function is called it returns the key saved earlier.

Parameters

string $theme: Name of the theme which default style is being saved/requested.

string|null $key: The key of theme's default style.

Return value

string|null The key of theme's default style.

3 calls to styleswitcher_theme_default_style_key()
styleswitcher_default_style_key in ./styleswitcher.module
Finds the default style and returns its key.
styleswitcher_styles_settings in ./styleswitcher.module
Returns a list of styles with theme-specific settings.
styleswitcher_theme_styles in ./styleswitcher.module
Returns a list of styles provided by a theme.

File

./styleswitcher.module, line 619
Module's hooks implementations and helper functions.

Code

function styleswitcher_theme_default_style_key($theme, $key = NULL) {
  static $default_key = array();
  if (isset($key)) {
    $default_key[$theme] = $key;
  }
  return isset($default_key[$theme]) ? $default_key[$theme] : NULL;
}