_drupal_load_stylesheet
includes/common.inc, строка 1999
- Версии
- 6
_drupal_load_stylesheet($matches)
Loads stylesheets recursively and returns contents with corrected paths.
This function is used for recursive loading of stylesheets and
returns the stylesheet content with all url()
paths corrected.
Код
<?php
function _drupal_load_stylesheet($matches) {
$filename = $matches[1];
// Load the imported stylesheet and replace @import commands in there as well.
$file = drupal_load_stylesheet($filename);
// Alter all url() paths, but not external.
return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. dirname($filename) .'/', $file);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии