class context_reaction_theme_html in Context 7.3
Expose themes as context reactions.
Hierarchy
- class \context_reaction
- class \context_reaction_theme
- class \context_reaction_theme_html
- class \context_reaction_theme
Expanded class hierarchy of context_reaction_theme_html
2 string references to 'context_reaction_theme_html'
- _context_context_plugins in ./
context.plugins.inc - Context plugins.
- _context_context_registry in ./
context.plugins.inc - Context registry.
File
- plugins/
context_reaction_theme_html.inc, line 5
View source
class context_reaction_theme_html extends context_reaction_theme {
/**
* Allow admins to provide additional body classes.
*/
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;
}
/**
* Set additional classes onto the 'body_classes'.
*/
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'];
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
context_reaction:: |
property | |||
context_reaction:: |
property | |||
context_reaction:: |
property | |||
context_reaction:: |
function | Retrieve options from the context provided. | 1 | |
context_reaction:: |
function | Retrieve active contexts that have values for this reaction. | ||
context_reaction:: |
function | Options form submit handler. | 3 | |
context_reaction:: |
function | Settings form. Provide variable settings for your reaction. | 2 | |
context_reaction:: |
function | Clone our references when we're being cloned. | ||
context_reaction:: |
function | Constructor. Do not override. | ||
context_reaction_theme:: |
function | Editor form. | ||
context_reaction_theme:: |
function | Submit handler for editor form. | ||
context_reaction_theme_html:: |
function |
Set additional classes onto the 'body_classes'. Overrides context_reaction_theme:: |
||
context_reaction_theme_html:: |
function |
Allow admins to provide additional body classes. Overrides context_reaction_theme:: |