You are here

function context_reaction_active_theme::execute in Context Reaction: Theme 7

Same name and namespace in other branches
  1. 6.2 plugins/context_reaction_active_theme.inc \context_reaction_active_theme::execute()

Return the active theme based on the context

Return value

string | null String of the theme name, or NULL if not to be altered.

File

plugins/context_reaction_theme.inc, line 57
Context plugin file to provide changing the active theme as a context reaction.

Class

context_reaction_active_theme
Expose themes as context reactions.

Code

function execute() {
  $theme = NULL;
  foreach ($this
    ->get_contexts() as $context) {
    if (isset($context->reactions['active_theme']['theme'])) {
      $theme = $context->reactions['active_theme']['theme'];
    }
  }
  return $theme;
}