context_reaction_theme_html.inc in Context 7.3
File
plugins/context_reaction_theme_html.inc
View source
<?php
class context_reaction_theme_html extends context_reaction_theme {
function options_form($context) {
$values = $this
->fetch_from_context($context);
$form = array(
'class' => array(
'#title' => t('Section class'),
'#description' => t('Provides this text as an additional body class (in <strong>$classes</strong> in html.tpl.php) when this section is active.'),
'#type' => 'textfield',
'#maxlength' => 64,
'#default_value' => isset($values['class']) ? $values['class'] : '',
),
);
return $form;
}
function execute(&$vars) {
$classes = array();
foreach ($this
->get_contexts() as $k => $v) {
if (!empty($v->reactions[$this->plugin]['class'])) {
$vars['classes_array'][] = $v->reactions[$this->plugin]['class'];
}
}
}
}