Index: zen/template.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/zen/zen/Attic/template.php,v
retrieving revision 1.44.2.8
diff -u -p -r1.44.2.8 template.php
--- zen/template.php	12 Aug 2009 07:31:13 -0000	1.44.2.8
+++ zen/template.php	24 Aug 2009 09:22:45 -0000
@@ -24,10 +24,10 @@ if (theme_get_setting('zen_rebuild_regis
  */
 if ($GLOBALS['theme'] == 'zen') { // If we're in the main theme
   if (theme_get_setting('zen_layout') == 'border-politics-fixed') {
-    drupal_add_css(drupal_get_path('theme', 'zen') . '/layout-fixed.css', 'theme', 'all');
+    drupal_add_css(_zen_path() . '/layout-fixed.css', 'theme', 'all');
   }
   else {
-    drupal_add_css(drupal_get_path('theme', 'zen') . '/layout-liquid.css', 'theme', 'all');
+    drupal_add_css(_zen_path() . '/layout-liquid.css', 'theme', 'all');
   }
 }
 
@@ -35,10 +35,7 @@ if ($GLOBALS['theme'] == 'zen') { // If 
  * Implements HOOK_theme().
  */
 function zen_theme(&$existing, $type, $theme, $path) {
-  if (!db_is_active()) {
-    return array();
-  }
-  include_once './' . drupal_get_path('theme', 'zen') . '/template.theme-registry.inc';
+  include_once './' . _zen_path() . '/template.theme-registry.inc';
   return _zen_theme($existing, $type, $theme, $path);
 }
 
@@ -158,6 +155,25 @@ function zen_preprocess_page(&$vars, $ho
 }
 
 /**
+ * Override or insert variables into the maintenance page template.
+ *
+ * @param $vars
+ *   An array of variables to pass to the theme template.
+ * @param $hook
+ *   The name of the template being rendered ("maintenance_page" in this case.)
+ */
+function zen_preprocess_maintenance_page(&$vars, $hook) {
+  // Add conditional stylesheets.
+  if (!module_exists('conditional_styles')) {
+    $vars['styles'] .= $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'], '');
+  }
+
+  // Classes for body element. Allows advanced theming based on context
+  // (home page, node of certain type, etc.)
+  $vars['body_classes_array'] = explode(' ', $vars['body_classes']);
+}
+
+/**
  * Override or insert variables into the node templates.
  *
  * @param $vars
@@ -198,7 +214,7 @@ function zen_preprocess_node(&$vars, $ho
  *   The name of the template being rendered ("comment" in this case.)
  */
 function zen_preprocess_comment(&$vars, $hook) {
-  include_once './' . drupal_get_path('theme', 'zen') . '/template.comment.inc';
+  include_once './' . _zen_path() . '/template.comment.inc';
   _zen_preprocess_comment($vars, $hook);
 }
 
@@ -224,7 +240,7 @@ function zen_preprocess_block(&$vars, $h
   $vars['edit_links_array'] = array();
   $vars['edit_links'] = '';
   if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) {
-    include_once './' . drupal_get_path('theme', 'zen') . '/template.block-editing.inc';
+    include_once './' . _zen_path() . '/template.block-editing.inc';
     zen_preprocess_block_editing($vars, $hook);
     $classes[] = 'with-block-editing';
   }
@@ -257,3 +273,20 @@ function zen_id_safe($string) {
   }
   return $string;
 }
+
+/**
+ * Returns the path to the Zen theme.
+ *
+ * drupal_get_filename() is broken; see #341140. When that is fixed in Drupal 6,
+ * replace _zen_path() with drupal_get_path('theme', 'zen').
+ */
+function _zen_path() {
+  static $path = FALSE;
+  if (!$path) {
+    $matches = drupal_system_listing('zen\.info$', 'themes', 'name', 0);
+    if (!empty($matches['zen']->filename)) {
+      $path = dirname($matches['zen']->filename);
+    }
+  }
+  return $path;
+}
Index: zen/template.conditional-styles.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/zen/zen/Attic/template.conditional-styles.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 template.conditional-styles.inc
--- zen/template.conditional-styles.inc	25 May 2009 16:25:50 -0000	1.1.2.1
+++ zen/template.conditional-styles.inc	24 Aug 2009 09:22:45 -0000
@@ -3,7 +3,7 @@
 // it has been spun out to its own separate module, It would be nice to prevent
 // code drift between the Zen implementation and the conditional_styles.module,
 // so Zen now includes an exact copy of conditonal_style module's:
-// conditional_styles.theme.inc,v 1.5 2009/05/25 14:33:03 johnalbin Exp
+// conditional_styles.theme.inc,v 1.6 2009/08/24 08:57:32 johnalbin Exp
 
 /**
  * @file
@@ -47,7 +47,7 @@ function _conditional_styles_theme($exis
   $themes = list_themes();
   foreach (array_keys($themes) AS $theme) {
     // We only need to process active themes.
-    if ($themes[$theme]->status) {
+    if ($themes[$theme]->status || $GLOBALS['theme'] == $theme) {
       $paths = conditional_styles_paths_to_basetheme($theme);
 
       // Grab all the conditional stylesheets.
Index: zen/template.theme-registry.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/zen/zen/Attic/template.theme-registry.inc,v
retrieving revision 1.7.2.4
diff -u -p -r1.7.2.4 template.theme-registry.inc
--- zen/template.theme-registry.inc	13 Feb 2009 18:44:31 -0000	1.7.2.4
+++ zen/template.theme-registry.inc	24 Aug 2009 09:22:45 -0000
@@ -14,7 +14,7 @@
 function _zen_theme(&$existing, $type, $theme, $path) {
   // Compute the conditional stylesheets.
   if (!module_exists('conditional_styles')) {
-    include_once './' . drupal_get_path('theme', 'zen') . '/template.conditional-styles.inc';
+    include_once './' . _zen_path() . '/template.conditional-styles.inc';
     // _conditional_styles_theme() only needs to be run once.
     if ($theme == 'zen') {
       _conditional_styles_theme($existing, $type, $theme, $path);
@@ -28,7 +28,7 @@ function _zen_theme(&$existing, $type, $
   // If we are auto-rebuilding the theme registry, warn about the feature.
   // Always display the warning in the admin section, otherwise limit to three
   // warnings per hour.
-  if (user_access('administer site configuration') && theme_get_setting('zen_rebuild_registry') && $theme == $GLOBALS['theme'] && (arg(0) == 'admin' || flood_is_allowed($GLOBALS['theme'] . '_rebuild_registry_warning', 3))) {
+  if (function_exists('user_access') && user_access('administer site configuration') && theme_get_setting('zen_rebuild_registry') && $theme == $GLOBALS['theme'] && (arg(0) == 'admin' || flood_is_allowed($GLOBALS['theme'] . '_rebuild_registry_warning', 3))) {
     flood_register_event($GLOBALS['theme'] . '_rebuild_registry_warning');
     drupal_set_message(t('For easier theme development, the theme registry is being rebuilt on every page request. It is <em>extremely</em> important to <a href="!link">turn off this feature</a> on production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning', FALSE);
   }
