You are here

function themekey_match_rules in ThemeKey 7.3

Same name and namespace in other branches
  1. 6.4 themekey_base.inc \themekey_match_rules()
  2. 6.2 themekey_base.inc \themekey_match_rules()
  3. 6.3 themekey_base.inc \themekey_match_rules()
  4. 7 themekey_base.inc \themekey_match_rules()
  5. 7.2 themekey_base.inc \themekey_match_rules()

This function steps through the rule chain and returns a theme.

Return value

array containing the name of the selected theme and the cascade of rules matched or NULL

1 call to themekey_match_rules()
themekey_custom_theme in ./themekey.module
Implements hook_custom_theme().

File

./themekey_base.inc, line 264
The functions in this file are the back end of ThemeKey.

Code

function themekey_match_rules() {
  $parameters = themekey_get_global_parameters();
  $result = themekey_match_rule_childs($parameters, array(
    'table' => 'themekey_properties',
    'format_rule_as_string_callback' => 'themekey_format_rule_as_string',
    'check_enabled_callback' => 'themekey_check_theme_enabled',
  ));
  if (!is_array($result)) {
    $result = NULL;
  }
  elseif ('ThemeKeyAdminTheme' === $result['theme']) {
    $result['theme'] = variable_get('admin_theme', '0');
  }
  return $result;
}