You are here

function cdn_theme_registry_alter in CDN 6.2

Implementation of hook_theme_registry_alter().

Make CDN's page preprocess function run *after* everything else's, so that a theme can't call drupal_get_js() and mess everything up.

Parameters

&$theme_registry: The entire cache of theme registry information, post-processing.

File

./cdn.module, line 233

Code

function cdn_theme_registry_alter(&$theme_registry) {
  if (!cdn_status_is_enabled()) {
    return;
  }

  // We only need to override CSS aggregation if the advagg module is not in
  // use; otherwise that module handles that perfectly fine already!
  $mode = variable_get(CDN_MODE_VARIABLE, CDN_MODE_BASIC);
  if ($mode == CDN_MODE_BASIC && !module_exists('advagg')) {
    $theme_registry['page']['preprocess functions'][] = '_cdn_css_aggregate';
  }
  if (variable_get(CDN_THEME_LAYER_FALLBACK_VARIABLE, FALSE)) {
    cdn_load_include('fallback');
    _cdn_fallback_theme_registry_alter($theme_registry);
  }
}