summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2008-07-01 20:22:22 (GMT)
committerDries Buytaert2008-07-01 20:22:22 (GMT)
commitfae9063c681b11cc48347a11b4dc0f06baffb4ce (patch)
tree76d67d82618930bbfdffe7b5bfa8ff35bb7bb866
parent0d76c733e7873f2451763e77d3c840c8d95cdf85 (diff)
- Patch #197124 by dixon_, keith.smith: made it possible to ignore a theme's stylesheets.
-rw-r--r--includes/common.inc29
-rw-r--r--includes/theme.inc4
2 files changed, 17 insertions, 16 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 9ec58b0..c9127a5 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 .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\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 .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\n";
- }
- else {
- $output .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\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 .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\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 .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\n";
+ }
+ else {
+ $output .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . base_path() . $file . $query_string . '" />' . "\n";
+ }
}
}
}
diff --git a/includes/theme.inc b/includes/theme.inc
index 3a3e81c..dae26aa 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -449,9 +449,7 @@ function list_themes($refresh = FALSE) {
foreach ($themes as $theme) {
foreach ($theme->info['stylesheets'] as $media => $stylesheets) {
foreach ($stylesheets as $stylesheet => $path) {
- if (file_exists($path)) {
- $theme->stylesheets[$media][$stylesheet] = $path;
- }
+ $theme->stylesheets[$media][$stylesheet] = $path;
}
}
foreach ($theme->info['scripts'] as $script => $path) {