You are here

function context_reaction_css_injector::execute in Context 7.3

Same name and namespace in other branches
  1. 6.3 plugins/context_reaction_css_injector.inc \context_reaction_css_injector::execute()
  2. 6 plugins/context_reaction_css_injector.inc \context_reaction_css_injector::execute()

File

plugins/context_reaction_css_injector.inc, line 21

Class

context_reaction_css_injector

Code

function execute() {
  $contexts = $this
    ->get_contexts();
  foreach ($contexts as $context) {
    if (!empty($context->reactions[$this->plugin])) {
      foreach ($context->reactions[$this->plugin] as $crid => $enabled) {
        if ($enabled && ($css_rule = _css_injector_load_rule($crid))) {
          drupal_add_css(_css_injector_rule_uri($crid), 'module', $css_rule['media'], $css_rule['preprocess']);
        }
      }
    }
  }
}