? fid.patch
? port.kpf
? remove_css.patch
? simple_themes.patch
? sites/port
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.675
diff -u -p -r1.675 common.inc
--- includes/common.inc	29 Jul 2007 17:28:23 -0000	1.675
+++ includes/common.inc	1 Aug 2007 20:44:05 -0000
@@ -1534,6 +1534,7 @@ function drupal_add_css($path = NULL, $t
  *   A string of XHTML CSS tags.
  */
 function drupal_get_css($css = NULL) {
+  global $theme;
   $output = '';
   if (!isset($css)) {
     $css = drupal_add_css();
@@ -1545,6 +1546,28 @@ function drupal_get_css($css = NULL) {
   $directory = file_directory_path();
   $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
 
+  // Filter out any .css files the theme has overridden.
+  if (isset($theme)) {
+    $theme = !empty($user->theme) && $themes[$user->theme]->status ? $user->theme : variable_get('theme_default', 'garland');
+    $themes = list_themes();
+    $theme = $themes[$theme];
+
+    foreach ($css as $media => $types) {
+      if (!empty($theme->info['remove-stylesheets'][$media])) {
+        foreach ($types as $type => $files) {
+          foreach ($files as $path => $bool) {
+            foreach ($theme->info['remove-stylesheets'][$media] as $remove_path) {
+              if (substr_count($path, $remove_path)) {
+                unset($css[$media][$type][$path]);
+                continue;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+
   foreach ($css as $media => $types) {
     // If CSS preprocessing is off, we still need to output the styles.
     // Additionally, go through any remaining styles if CSS preprocessing is on and output the non-cached ones.