You are here

function js_injector_context_page_reaction in Context 6.2

Implementation hook_context_page_reaction() on behalf of js injector.

File

context_contrib/context_contrib.module, line 230

Code

function js_injector_context_page_reaction() {
  $js_rules = context_active_values('js_injector');
  if (!empty($js_rules)) {
    foreach ($js_rules as $crid) {
      if ($js_rule = _js_injector_load_rule($crid)) {
        drupal_add_js(file_create_path($js_rule['file_path']), 'module', $js_rule['scope'], FALSE, $js_rule['cache'], $js_rule['preprocess']);
      }
    }
  }
  else {
    return;
  }
}