You are here

function advagg_module_implements_alter in Advanced CSS/JS Aggregation 7.2

Same name and namespace in other branches
  1. 8.4 advagg.module \advagg_module_implements_alter()
  2. 8.2 advagg.module \advagg_module_implements_alter()
  3. 8.3 advagg.module \advagg_module_implements_alter()

Implements hook_module_implements_alter().

File

./advagg.module, line 611
Advanced CSS/JS aggregation module.

Code

function advagg_module_implements_alter(&$implementations, $hook) {

  // Move advagg_theme_registry_alter to the top.
  if ($hook === 'theme_registry_alter' && array_key_exists('advagg', $implementations)) {
    $item = array(
      'advagg' => $implementations['advagg'],
    );
    unset($implementations['advagg']);
    $implementations = array_merge($item, $implementations);
  }

  // Move advagg_ajax_render_alter to the top.
  if ($hook === 'ajax_render_alter' && array_key_exists('advagg', $implementations)) {
    $item = array(
      'advagg' => $implementations['advagg'],
    );
    unset($implementations['advagg']);
    $implementations = array_merge($item, $implementations);
  }

  // Move advagg_element_info_alter to the bottom.
  if ($hook === 'element_info_alter' && array_key_exists('advagg', $implementations)) {
    $item = $implementations['advagg'];
    unset($implementations['advagg']);
    $implementations['advagg'] = $item;
  }

  // Replace locale_js_alter with _advagg_locale_js_alter.
  if ($hook === 'js_alter' && array_key_exists('locale', $implementations)) {
    unset($implementations['locale']);
    $implementations['_advagg_locale'] = FALSE;
  }

  // Move advagg_file_url_alter to the bottom.
  if ($hook === 'file_url_alter' && array_key_exists('advagg', $implementations)) {
    $item = $implementations['advagg'];
    unset($implementations['advagg']);
    $implementations['advagg'] = $item;
  }
  if ($hook === 'requirements') {

    // Move advagg_requirements to the bottom.
    if (array_key_exists('advagg', $implementations)) {
      $item = $implementations['advagg'];
      unset($implementations['advagg']);
      $implementations['advagg'] = $item;
    }

    // Move advagg_css_cdn to the bottom.
    if (array_key_exists('advagg_css_cdn', $implementations)) {
      $item = $implementations['advagg_css_cdn'];
      unset($implementations['advagg_css_cdn']);
      $implementations['advagg_css_cdn'] = $item;
    }

    // Move advagg_css_compress to the bottom.
    if (array_key_exists('advagg_css_compress', $implementations)) {
      $item = $implementations['advagg_css_compress'];
      unset($implementations['advagg_css_compress']);
      $implementations['advagg_css_compress'] = $item;
    }

    // Move advagg_js_cdn to the bottom.
    if (array_key_exists('advagg_js_cdn', $implementations)) {
      $item = $implementations['advagg_js_cdn'];
      unset($implementations['advagg_js_cdn']);
      $implementations['advagg_js_cdn'] = $item;
    }

    // Move advagg_js_compress to the bottom.
    if (array_key_exists('advagg_js_compress', $implementations)) {
      $item = $implementations['advagg_js_compress'];
      unset($implementations['advagg_js_compress']);
      $implementations['advagg_js_compress'] = $item;
    }
  }

  // Move advagg_cron to the bottom.
  if ($hook === 'cron' && array_key_exists('advagg', $implementations)) {
    $item = $implementations['advagg'];
    unset($implementations['advagg']);
    $implementations['advagg'] = $item;
  }
}