From fae9063c681b11cc48347a11b4dc0f06baffb4ce Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 1 Jul 2008 20:22:22 +0000 Subject: - Patch #197124 by dixon_, keith.smith: made it possible to ignore a theme's stylesheets. --- includes/common.inc | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index 9ec58b08e..c9127a5bd 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1728,19 +1728,22 @@ function drupal_get_css($css = NULL) { unset($types[$type][$file]); continue; } - if (!$preprocess || !($is_writable && $preprocess_css)) { - // If a CSS file is not to be preprocessed and it's a module CSS file, it needs to *always* appear at the *top*, - // regardless of whether preprocessing is on or off. - if (!$preprocess && $type == 'module') { - $no_module_preprocess .= '' . "\n"; - } - // If a CSS file is not to be preprocessed and it's a theme CSS file, it needs to *always* appear at the *bottom*, - // regardless of whether preprocessing is on or off. - else if (!$preprocess && $type == 'theme') { - $no_theme_preprocess .= '' . "\n"; - } - else { - $output .= '' . "\n"; + // Only include the stylesheet if it exists. + if (file_exists($file)) { + if (!$preprocess || !($is_writable && $preprocess_css)) { + // If a CSS file is not to be preprocessed and it's a module CSS file, it needs to *always* appear at the *top*, + // regardless of whether preprocessing is on or off. + if (!$preprocess && $type == 'module') { + $no_module_preprocess .= '' . "\n"; + } + // If a CSS file is not to be preprocessed and it's a theme CSS file, it needs to *always* appear at the *bottom*, + // regardless of whether preprocessing is on or off. + else if (!$preprocess && $type == 'theme') { + $no_theme_preprocess .= '' . "\n"; + } + else { + $output .= '' . "\n"; + } } } } -- cgit v1.2.3