class supersized_context_reaction in Supersized 8
Same name and namespace in other branches
- 7 supersized_context/supersized_context_reaction.inc \supersized_context_reaction
@file Reaction class of supersized.
To apply Supersized.
Hierarchy
- class \supersized_context_reaction extends \context_reaction
Expanded class hierarchy of supersized_context_reaction
2 string references to 'supersized_context_reaction'
- supersized_context_context_plugins in supersized_context/
supersized_context.module - Implements hook_context_plugins().
- supersized_context_context_registry in supersized_context/
supersized_context.module - Implements hook_context_registry().
File
- supersized_context/
supersized_context_reaction.inc, line 9 - Reaction class of supersized.
View source
class supersized_context_reaction extends context_reaction {
/**
* Construct option form.
*/
function options_form($context) {
$values = $this
->fetch_from_context($context);
$form['#tree'] = TRUE;
$form['nid'] = array(
'#type' => 'textfield',
'#title' => t('Content'),
'#autocomplete_path' => 'supersized/autocomplete',
'#maxlength' => 1024,
'#default_value' => $values ? $values['nid'] : NULL,
'#description' => t('Slides of the content will be used as the supersized.'),
);
return $form;
}
/**
* See if context contains redirect reaction.
*/
function execute() {
$contexts = context_active_contexts();
foreach ($contexts as $context) {
if (!empty($context->reactions[$this->plugin])) {
preg_match('/\\[nid: (\\d+)\\]$/', $context->reactions[$this->plugin]['nid'], $matches);
$nid = $matches[1];
return $nid;
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
supersized_context_reaction:: |
function | See if context contains redirect reaction. | ||
supersized_context_reaction:: |
function | Construct option form. |