You are here

function themekey_compat_dummy2theme in ThemeKey 7.3

Same name and namespace in other branches
  1. 7 themekey_compat.module \themekey_compat_dummy2theme()
  2. 7.2 themekey_compat.module \themekey_compat_dummy2theme()

This function implements the interface of a ThemeKey mapping function but doesn't set a ThemeKey property's value. It sets the Drupal static themekey_custom_theme which will cause ThemeKey to use this theme.

Parameters

$dummy: dummy

Return value

string "static" if global custom theme has been set or NULL if no theme has been assigned to the node

1 string reference to 'themekey_compat_dummy2theme'
themekey_compat_themekey_properties in ./themekey_compat.module
Implements hook_themekey_properties().

File

./themekey_compat.module, line 90
Integration of different theme switching modules into ThemeKey and its theme switching rule chain.

Code

function themekey_compat_dummy2theme($dummy, $args) {
  $custom_theme =& drupal_static('themekey_custom_theme', '');
  $function = $args['module'] . '_custom_theme';
  if (function_exists($function)) {
    $custom_theme = $function();
    if ($custom_theme && (!in_array($args['module'], variable_get('themekey_compat_modules_enabled', array())) || variable_get('theme_default', 'bartik') != $custom_theme)) {
      if (variable_get('themekey_debug_trace_rule_switching', FALSE)) {
        themekey_set_debug_message('Theme set to %theme by module %module.', array(
          '%theme' => $custom_theme,
          '%module' => $args['module'],
        ));
      }
      return 'static';
    }
  }
  return NULL;
}