class IsotopeReaction in Brainstorm profile 7
Expose isotope configurations as context reactions.
Hierarchy
- class \context_reaction
- class \IsotopeReaction
Expanded class hierarchy of IsotopeReaction
2 string references to 'IsotopeReaction'
- views_isotope_context_plugins in modules/
custom/ views_isotope/ views_isotope.module - Implements hook_context_plugins().
- views_isotope_context_registry in modules/
custom/ views_isotope/ views_isotope.module - Implements hook_context_registry().
File
- modules/
custom/ views_isotope/ plugins/ context/ views_isotope_reaction.inc, line 11 - Contains the isotope_reaction subclass.
View source
class IsotopeReaction extends context_reaction {
/**
* Editor form.
*/
public function editorForm($context) {
$form = $this
->optionsForm($context);
return $form;
}
/**
* Submit handler for editor form.
*/
public function editorFormSubmit($context, $values) {
return $values;
}
/**
* Configuration form for the Isotope context reaction.
*/
public function optionsForm($context) {
$values = $this
->fetch_from_context($context);
$form = [
'#tree' => TRUE,
'#title' => t('Isotope'),
'pre' => [
'#type' => 'item',
'#title' => t('Isotope Configuration'),
'#description' => t('You can manage these configurations at !link.', [
'!link' => l(t('Configure Isotope'), 'admin/config/user-interface/isotope'),
]),
],
// Choose the config here.
'config' => [
'#type' => 'select',
'#options' => views_isotope_available_configs(),
'#title' => t('Choose Isotope Configuration'),
'#default_value' => isset($values['config']) ? $values['config'] : 'isotope_default_config',
],
];
return $form;
}
/**
* Display a message to the user.
*/
public function execute() {
foreach ($this
->get_contexts() as $k => $v) {
if (!empty($v->reactions[$this->plugin]['config'])) {
return $v->reactions[$this->plugin]['config'];
}
}
}
}
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 | 7 | ||
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. | ||
IsotopeReaction:: |
public | function | Editor form. | |
IsotopeReaction:: |
public | function | Submit handler for editor form. | |
IsotopeReaction:: |
public | function | Display a message to the user. | |
IsotopeReaction:: |
public | function | Configuration form for the Isotope context reaction. |