class context_reaction_css_injector in Context 6.3
Same name and namespace in other branches
- 6 plugins/context_reaction_css_injector.inc \context_reaction_css_injector
- 7.3 plugins/context_reaction_css_injector.inc \context_reaction_css_injector
Hierarchy
- class \context_reaction
Expanded class hierarchy of context_reaction_css_injector
2 string references to 'context_reaction_css_injector'
- _context_context_plugins in ./
context.plugins.inc - Context plugins.
- _context_context_registry in ./
context.plugins.inc - Context registry.
File
- plugins/
context_reaction_css_injector.inc, line 3
View source
class context_reaction_css_injector extends context_reaction {
function options_form($context) {
$list = array();
foreach (_css_injector_load_rule() as $css_rule) {
$list[$css_rule['crid']] = $css_rule['title'];
}
ksort($list);
return array(
'#title' => $this->title,
'#description' => $this->description,
'#options' => $list,
'#type' => 'checkboxes',
'#default_value' => $this
->fetch_from_context($context),
);
}
function execute() {
$contexts = $this
->get_contexts();
foreach ($contexts as $context) {
if (!empty($context->reactions[$this->plugin])) {
foreach ($context->reactions[$this->plugin] as $crid) {
if ($css_rule = _css_injector_load_rule($crid)) {
drupal_add_css(file_create_path($css_rule['file_path']), 'module', $css_rule['media'], $css_rule['preprocess']);
}
}
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
context_reaction:: |
property | |||
context_reaction:: |
property | |||
context_reaction:: |
property | |||
context_reaction:: |
function | Retrieve options from the context provided. | ||
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. | 1 | |
context_reaction:: |
function | Clone our references when we're being cloned. | ||
context_reaction:: |
function | Constructor. Do not override. | ||
context_reaction_css_injector:: |
function | |||
context_reaction_css_injector:: |
function |
Overrides context_reaction:: |