You are here

function advagg_mod_theme_registry_alter in Advanced CSS/JS Aggregation 7.2

Implements hook_theme_registry_alter().

Insert advagg_mod_process_move_js before _advagg_process_html.

File

advagg_mod/advagg_mod.module, line 518
Advanced aggregation modifier module.

Code

function advagg_mod_theme_registry_alter(&$theme_registry) {
  if (!module_exists('advagg') || !advagg_enabled()) {
    return;
  }
  if (!isset($theme_registry['html'])) {
    return;
  }

  // Find template_process_html/_advagg_process_html.
  $index = array_search('_advagg_process_html', $theme_registry['html']['process functions']);
  if ($index === FALSE) {
    $index = array_search('template_process_html', $theme_registry['html']['process functions']);
    if ($index === FALSE) {
      return;
    }
  }

  // Insert advagg_mod_process_move_js before _advagg_process_html.
  array_splice($theme_registry['html']['process functions'], $index, 0, 'advagg_mod_process_move_js');
}