class context_reaction_delta in Delta 7.2
Same name and namespace in other branches
- 7.3 plugins/context/context_reaction_delta.inc \context_reaction_delta
Expose themes as context reactions.
Hierarchy
- class \context_reaction
- class \context_reaction_delta
Expanded class hierarchy of context_reaction_delta
2 string references to 'context_reaction_delta'
- delta_context_plugins in ./
delta.module - Implementation of hook_context_plugins().
- delta_context_registry in ./
delta.module - Implementation of hook_context_registry().
File
- plugins/
context_reaction_delta.inc, line 6
View source
class context_reaction_delta extends context_reaction {
/**
* ugh
*/
function options_form($context) {
$values = $this
->fetch_from_context($context);
$form = array(
'#tree' => TRUE,
'#title' => t('Delta Override Template'),
);
$sql = "\n \t SELECT dt.name, dt.system_name, dt.tid \n \t FROM {delta_theme_settings} dt\n \t ORDER BY dt.name ASC";
$result = db_query($sql, array(), array(
'fetch' => PDO::FETCH_ASSOC,
));
$options = array();
foreach ($result as $item) {
$options[$item['system_name']] = $item['name'];
}
$form['delta_template'] = array(
'#type' => 'radios',
'#title' => t('Select Custom theme settings template.'),
'#default_value' => isset($values['delta_template']) ? $values['delta_template'] : '',
'#options' => $options,
);
return $form;
}
/**
* Set 'section_title', and 'section_subtitle' if not set and merge all
* additional classes onto the 'body_classes'.
*/
function execute(&$vars) {
$contexts = context_active_contexts();
foreach ($contexts as $context) {
if (!empty($context->reactions['delta'])) {
// add the delta override variable to the $vars so it can be used in omega_preprocess
$vars['delta'] = 'theme_delta_' . $context->reactions['delta']['delta_template'] . '_settings';
// allow delta to load it's own custom form data, emulating a custom theme.
global $delta_template;
$delta_template = isset($vars['delta']) ? $vars['delta'] : NULL;
}
}
}
}
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_delta:: |
function | Set 'section_title', and 'section_subtitle' if not set and merge all additional classes onto the 'body_classes'. | ||
context_reaction_delta:: |
function |
ugh Overrides context_reaction:: |