Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.607 diff -u -p -r1.607 theme.inc --- includes/theme.inc 2 Sep 2010 15:58:53 -0000 1.607 +++ includes/theme.inc 4 Sep 2010 06:41:07 -0000 @@ -143,6 +143,17 @@ function _drupal_theme_initialize($theme // Grab stylesheets from base theme foreach ($base_theme as $base) { + // Remove base stylesheets. + if (!empty($base->stylesheets_remove)) { + foreach ($final_stylesheets as $media => $stylesheets) { + foreach ($stylesheets as $name => $stylesheet) { + if (isset($base->stylesheets_remove[$name])) { + unset($final_stylesheets[$media][$name]); + } + } + } + } + // Add stylesheets. if (!empty($base->stylesheets)) { foreach ($base->stylesheets as $media => $stylesheets) { foreach ($stylesheets as $name => $stylesheet) { @@ -151,7 +162,16 @@ function _drupal_theme_initialize($theme } } } - + // Remove stylesheets specified by this theme. + if (!empty($theme->stylesheets_remove)) { + foreach ($final_stylesheets as $media => $stylesheets) { + foreach ($stylesheets as $name => $stylesheet) { + if (isset($theme->stylesheets_remove[$name])) { + unset($final_stylesheets[$media][$name]); + } + } + } + } // Add stylesheets used by this theme. if (!empty($theme->stylesheets)) { foreach ($theme->stylesheets as $media => $stylesheets) { @@ -601,7 +621,14 @@ function list_themes($refresh = FALSE) { foreach ($themes as $theme) { foreach ($theme->info['stylesheets'] as $media => $stylesheets) { foreach ($stylesheets as $stylesheet => $path) { - $theme->stylesheets[$media][$stylesheet] = $path; + if (file_exists($path)) { + $theme->stylesheets[$media][$stylesheet] = $path; + } + } + } + if (isset($theme->info['stylesheets-remove'])) { + foreach ($theme->info['stylesheets-remove'] as $stylesheet) { + $theme->stylesheets_remove[$stylesheet] = $stylesheet; } } foreach ($theme->info['scripts'] as $script => $path) {