You are here

function advagg_relocate_load_stylesheet_local in Advanced CSS/JS Aggregation 7.2

Convert local @import statements to external.

Parameters

array $matches: Array of matched items from preg_replace_callback().

string $url: URL of where the original CSS is located.

Return value

string New import statement.

1 call to advagg_relocate_load_stylesheet_local()
advagg_relocate_css_post_alter in advagg_relocate/advagg_relocate.module
Alter the css array.
1 string reference to 'advagg_relocate_load_stylesheet_local'
advagg_relocate_css_post_alter in advagg_relocate/advagg_relocate.module
Alter the css array.

File

advagg_relocate/advagg_relocate.module, line 1165
Advanced aggregation relocate module.

Code

function advagg_relocate_load_stylesheet_local(array $matches, $url = '') {
  $_url =& drupal_static(__FUNCTION__, '');

  // Store base path for preg_replace_callback.
  if (!empty($url)) {
    $_url = $url;
  }

  // Short circuit if no matches were passed in.
  if (empty($matches)) {
    return '';
  }
  $css_url = $_url . $matches[1];
  return "@import \"{$css_url}\";";
}