? files
? themesettings.patch
? sites/default/mysettings.php
? sites/default/settings.php
? themes/redshoes
Index: .htaccess
===================================================================
RCS file: /cvs/drupal/drupal/.htaccess,v
retrieving revision 1.85
diff -u -p -r1.85 .htaccess
--- .htaccess	18 May 2007 22:09:45 -0000	1.85
+++ .htaccess	24 Jun 2007 07:58:30 -0000
@@ -84,7 +84,7 @@ DirectoryIndex index.php
 
   # Modify the RewriteBase if you are using Drupal in a subdirectory and
   # the rewrite rules are not working properly.
-  #RewriteBase /drupal
+  RewriteBase /
 
   # Rewrite URLs of the form 'index.php?q=x'.
   RewriteCond %{REQUEST_FILENAME} !-f
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.495
diff -u -p -r1.495 system.module
--- modules/system/system.module	22 Jun 2007 08:32:28 -0000	1.495
+++ modules/system/system.module	24 Jun 2007 07:58:31 -0000
@@ -2368,19 +2368,43 @@ function system_theme_settings(&$form_st
   }
 
   if ($key) {
-    // Template-specific settings
-    $function = $themes[$key]->prefix .'_settings';
+    // If no administration theme is set, switch themes when displaying the theme settings.
+    if (variable_get('admin_theme', '0') == '0') {
+      global $custom_theme;
+      $custom_theme = $key;
+      init_theme();
+    }
+    // Include the theme's settings.php file
+    $filename = './'. str_replace("/$key.info", '', $themes[$key]->filename) .'/settings.php';
+    if (!file_exists($filename) and !empty($themes[$key]->info['base theme'])) {
+      // If the theme doesn't have a settings.php file, use the base theme's.
+      $base = $themes[$key]->info['base theme'];
+      $filename = './'. str_replace("/$base.info", '', $themes[$base]->filename) .'/settings.php';
+    }
+    if (file_exists($filename)) {
+      require_once $filename;
+    }
+
+    // Call engine-specific settings.
+    $function = $themes[$key]->prefix .'_engine_settings';
     if (function_exists($function)) {
-      if ($themes[$key]->template) {
-        // file is a template or a style of a template
-        $form['specific'] = array('#type' => 'fieldset', '#title' => t('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)));
+      $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_merge($form['engine_specific'], $group);
       }
-      else {
-        // file is a theme or a style of a theme
-        $form['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]->prefix)));
+    }
+    // Call theme-specific settings.
+    $function = $key .'_settings';
+    if (!function_exists($function)) {
+      $function = $themes[$key]->prefix .'_settings';
+    }
+    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_merge($form['theme_specific'], $group);
       }
-      $group = $function();
-      $form['specific'] = array_merge($form['specific'], (is_array($group) ? $group : array()));
     }
   }
   $form['#attributes'] = array('enctype' => 'multipart/form-data');
