function context_reaction_theme::execute in Context 6
Same name and namespace in other branches
- 6.3 plugins/context_reaction_theme.inc \context_reaction_theme::execute()
- 7.3 plugins/context_reaction_theme.inc \context_reaction_theme::execute()
Set 'section_title', and 'section_subtitle' if not set and merge all additional classes onto the 'body_classes'.
File
- plugins/
context_reaction_theme.inc, line 64
Class
- context_reaction_theme
- Expose themes as context reactions.
Code
function execute(&$vars) {
$classes = array();
foreach ($this
->get_contexts() as $k => $v) {
if (!empty($v->reactions[$this->plugin]['title']) && !isset($vars['section_title'])) {
$vars['section_title'] = t($v->reactions[$this->plugin]['title']);
}
if (!empty($v->reactions[$this->plugin]['subtitle']) && !isset($vars['section_subtitle'])) {
$vars['section_subtitle'] = t($v->reactions[$this->plugin]['subtitle']);
}
if (!empty($v->reactions[$this->plugin]['class'])) {
$vars['classes_array'][] = $v->reactions[$this->plugin]['class'];
}
}
}