You are here

function hook_advagg_js_groups_alter in Advanced CSS/JS Aggregation 7.2

Allow other modules to modify $js_groups right before it is processed.

Parameters

array $js_groups: An associative array. key - group.

bool $preprocess_js: TRUE if preprocessing is enabled.

See also

_advagg_aggregate_js()

labjs_advagg_js_groups_alter()

Related topics

1 invocation of hook_advagg_js_groups_alter()
_advagg_aggregate_js in ./advagg.module
Default callback to aggregate JavaScript files.

File

./advagg.api.php, line 416
Hooks provided by the AdvAgg module.

Code

function hook_advagg_js_groups_alter(array &$js_groups, $preprocess_js) {
  if (!$preprocess_js) {
    return;
  }
  $labjs_location = labjs_get_path();
  foreach ($js_groups as &$data) {
    foreach ($data['items'] as &$values) {
      if ($values['data'] == $labjs_location) {

        // Strictly enforce preprocess = FALSE for labjs.
        $values['preprocess'] = FALSE;
        $data['preprocess'] = FALSE;
        break 2;
      }
    }
    unset($values);
  }
  unset($data);
}