Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.63.2.13
diff -u -r1.63.2.13 system.admin.inc
--- modules/system/system.admin.inc	16 Sep 2009 18:02:32 -0000	1.63.2.13
+++ modules/system/system.admin.inc	6 Nov 2009 09:03:38 -0000
@@ -503,27 +503,58 @@
   }
 
   if ($key) {
-    // Include the theme's theme-settings.php file
-    $filename = './'. str_replace("/$key.info", '', $themes[$key]->filename) .'/theme-settings.php';
-    if (!file_exists($filename) and !empty($themes[$key]->info['base theme'])) {
-      // If the theme doesn't have a theme-settings.php file, use the base theme's.
-      $base = $themes[$key]->info['base theme'];
-      $filename = './'. str_replace("/$base.info", '', $themes[$base]->filename) .'/theme-settings.php';
+    // Create a list of the current theme's base themes.
+    if (isset($themes[$key]->base_themes)) {
+      $theme_keys = array_keys($themes[$key]->base_themes);
     }
+
+    // Include the current theme's theme-settings.php file.
+    $filename = './'. str_replace("/$key.info", '', $themes[$key]->filename) .'/theme-settings.php';
     if (file_exists($filename)) {
       require_once $filename;
     }
 
-    // Call engine-specific settings.
+    // Include any base theme theme-settings.php files.
+    foreach ($theme_keys as $theme) {
+      $filename = './' . str_replace("/$theme.info", '', $themes[$theme]->filename) . '/theme-settings.php';
+      if (file_exists($filename)) {
+        require_once $filename;
+      }
+    }
+
+    // Call and merge engine-specific settings.
     $function = $themes[$key]->prefix .'_engine_settings';
     if (function_exists($function)) {
       $group = $function($settings);
       if (!empty($group)) {
-        $form['engine_specific'] = array('#type' => 'fieldset', '#title' => t('Theme-engine-specific settings'), '#description' => t('These settings only exist for all the templates and styles based on the %engine theme engine.', array('%engine' => $themes[$key]->prefix)));
+        $form['engine_specific'] = array(
+          '#type' => 'fieldset',
+          '#title' => t('Theme-engine-specific settings'),
+          '#description' => t('These settings only exist for all the templates and styles based on the %engine theme engine.', array('%engine' => $themes[$key]->prefix))
+        );
         $form['engine_specific'] = array_merge($form['engine_specific'], $group);
       }
     }
-    // Call theme-specific settings.
+
+    // Call and merge base theme settings.
+    $base_themes = array();
+    foreach ($theme_keys as $theme) {
+      $function = $theme .'_settings';
+      if (function_exists($function)) {
+        $group = $function($settings, $form);
+        if (!empty($group)) {
+          $base_themes[] = $themes[$theme]->info['name'];
+          $form['base_theme_specific'] = array(
+            '#type' => 'fieldset',
+            '#title' => t('Base theme settings'),
+            '#description' => t('These settings are inherited from one or more base themes: %theme.', array('%theme' => implode($base_themes, ', ')))
+          );
+          $form['base_theme_specific'] = array_merge($form['base_theme_specific'], $group);
+        }
+      }
+    }
+
+    // Call and merge current theme-specific settings.
     $function = $key .'_settings';
     if (!function_exists($function)) {
       $function = $themes[$key]->prefix .'_settings';
@@ -531,7 +562,11 @@
     if (function_exists($function)) {
       $group = $function($settings);
       if (!empty($group)) {
-        $form['theme_specific'] = array('#type' => 'fieldset', '#title' => t('Theme-specific settings'), '#description' => t('These settings only exist for the %theme theme and all the styles based on it.', array('%theme' => $themes[$key]->info['name'])));
+        $form['theme_specific'] = array(
+          '#type' => 'fieldset',
+          '#title' => t('Theme-specific settings'),
+          '#description' => t('These settings belong to the %theme theme.', array('%theme' => $themes[$key]->info['name']))
+        );
         $form['theme_specific'] = array_merge($form['theme_specific'], $group);
       }
     }

