? generate_stylesheet.inc
Index: vertical_tabs.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/vertical_tabs/vertical_tabs.install,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 vertical_tabs.install
--- vertical_tabs.install	5 Jan 2009 23:37:01 -0000	1.1.2.3
+++ vertical_tabs.install	8 Jan 2009 09:35:44 -0000
@@ -34,9 +34,13 @@ function vertical_tabs_update_6101() {
  */
 function vertical_tabs_install_color_generate() {
   if (variable_get('theme_default', 'garland') == 'garland' || variable_get('admin_theme', '0') == 'garland') {
-    $theme = 'garland';
-    $info = color_get_info($theme);
-    $palette = color_get_palette($theme);
-    vertical_tabs_generate_stylesheet('garland', $info, $palette);
+    if (module_exists('color')) {
+      $theme = 'garland';
+      $info = color_get_info($theme);
+      $palette = color_get_palette($theme);
+
+      module_load_include('inc', 'vertical_tabs', 'generate_stylesheet');
+      vertical_tabs_generate_stylesheet('garland', $info, $palette);
+    }
   }
-}
\ No newline at end of file
+}
Index: vertical_tabs.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/vertical_tabs/vertical_tabs.module,v
retrieving revision 1.1.2.15
diff -u -p -r1.1.2.15 vertical_tabs.module
--- vertical_tabs.module	6 Jan 2009 03:47:04 -0000	1.1.2.15
+++ vertical_tabs.module	8 Jan 2009 09:35:44 -0000
@@ -185,47 +185,11 @@ function vertical_tabs_color_submit($for
     }
   }
 
+  module_load_include('inc', 'vertical_tabs', 'generate_stylesheet');
   vertical_tabs_generate_stylesheet($theme, $info, $palette);
 }
 
 /**
- * Color module support for Garland and Vertical Tabs.
- *
- * Most of this function is direct copy/paste from color_scheme_form_submit().
- */
-function vertical_tabs_generate_stylesheet($theme, $info, $palette) {
-  // Current CSS files.
-  $css = variable_get('color_'. $theme .'_stylesheets', array());
-  $files = variable_get('color_'. $theme .'_files', array());
-
-  // Template file.
-  $file = 'vertical_tabs.garland.css';
-
-  // Prepare target locations for generated files.
-  $paths['color'] = file_directory_path() .'/color';
-  $paths['source'] = drupal_get_path('module', 'vertical_tabs') .'/garland/';
-  $paths['files'] = $paths['map'] = array();
-
-  if (count($css)) {
-    $paths['id'] = preg_replace('/^.*?('. $theme .'-[a-zA-Z0-9]+).*?$/', '$1', $css[0]);
-    $paths['target'] = $paths['color'] .'/'. $paths['id'] .'/';
-
-    $style = drupal_load_stylesheet($paths['source'] . $file, FALSE);
-
-    // Rewrite stylesheet with new colors.
-    $style = _color_rewrite_stylesheet($theme, $info, $paths, $palette, $style);
-    $base_file = basename($file);
-    $css[] = $paths['target'] . $base_file;
-    $files[] = $paths['target'] . $base_file;
-    _color_save_stylesheet($paths['target'] . $base_file, $style, $paths);
-
-    // Update the list of files.
-    variable_set('color_'. $theme .'_stylesheets', $css);
-    variable_set('color_'. $theme .'_files', $files);
-  }
-}
-
-/**
  * Retrieve the default set of enabled fieldsets that support vertical tabs.
  */
 function vertical_tabs_fieldsets($node_type) {
