You are here

function cdn_preprocess_page in CDN 6.2

Implementation of template_preprocess_page().

1 string reference to 'cdn_preprocess_page'
_cdn_fallback_theme_registry_alter in ./cdn.fallback.inc
Implementation of hook_theme_registry_alter().

File

./cdn.fallback.inc, line 38
Fallback when hook_file_url_alter() is not available (i.e. when the core patch is not installed or when not using a patched Drupal distribution): use the Parallel module's logic (with some adaptations to be able to use the CDN module's logic…

Code

function cdn_preprocess_page(&$variables) {

  // CSS.
  cdn_html_alter_css_urls($variables['styles']);

  // JS.
  cdn_html_alter_js_urls($variables['scripts']);
  cdn_html_alter_js_urls($variables['closure']);

  // Images.
  $skip_keys = array(
    'styles',
    'scripts',
    'zebra',
    'id',
    'directory',
    'layout',
    'head_title',
    'base_path',
    'front_page',
    'head',
    'body_classes',
  );
  foreach ($variables as $key => $value) {
    if (!in_array($key, $skip_keys) && is_string($value) && !empty($value)) {
      cdn_html_alter_image_urls($variables[$key]);
    }
  }
}