Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.382 diff -u -p -r1.382 theme.inc --- includes/theme.inc 10 Sep 2007 13:28:22 -0000 1.382 +++ includes/theme.inc 17 Sep 2007 17:12:11 -0000 @@ -981,33 +981,69 @@ function theme_placeholder($text) { * FALSE can be useful to postpone the messages to a subsequent page. */ function theme_maintenance_page($content, $show_messages = TRUE) { + + // Set up paths to check for various elements. + $paths[] = conf_path() .'/maintenance'; + if (conf_path() != 'sites/default') { + $paths[] = 'sites/default/maintenance'; + } + $paths[] = 'misc'; + + // The order of discovery for each item is based on these paths: + // 1. sites/example.com/maintenance + // 2. sites/default/maintenance + // 3. misc (the defaults for favicon.ico and maintenance.tpl.php.) + foreach ($paths as $path) { + if (!isset($template) && file_exists($path .'/maintenance.tpl.php')) { + $template = $path .'/maintenance.tpl.php'; + // Variable is dependent on the location of the template file. + $path_to_theme = $path; + } + if (!isset($maintenance_style) && file_exists($path .'/maintenance.css')) { + $maintenance_style = $path .'/maintenance.css'; + } + if (!isset($favicon) && file_exists($path . '/favicon.ico')) { + $favicon = $path . '/favicon.ico'; + } + if (!isset($theme_style) && file_exists($path .'/style.css')) { + $theme_style = $path .'/style.css'; + } + if (!isset($logo) && file_exists($path .'/logo.png')) { + $logo = $path .'/logo.png'; + } + } + // Set required headers. drupal_set_header('Content-Type: text/html; charset=utf-8'); - drupal_set_html_head(''); - drupal_set_html_head(''); - drupal_set_html_head(''); - drupal_set_html_head(''); + drupal_set_html_head(''); + + drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module'); + drupal_add_css(drupal_get_path('module', 'system') .'/system.css', 'module'); + drupal_add_css($maintenance_style, 'module'); + if (!isset($theme_style)) { + $theme_style = 'themes/garland/minnelli/style.css'; + } + drupal_add_css($theme_style, 'theme'); // Prepare variables. $variables = array( 'head_title' => strip_tags(drupal_get_title()), 'head' => drupal_get_html_head(), - 'styles' => '', + 'styles' => drupal_get_css(), 'scripts' => drupal_get_js(), 'left' => drupal_get_content('left'), 'right' => drupal_get_content('right'), 'base_path' => base_path(), - 'path_to_theme' => base_path() .'themes/garland/minnelli', - 'logo' => base_path() .'themes/garland/minnelli/logo.png', - 'site_title' => t('Drupal'), + 'path_to_theme' => $path_to_theme, + 'paths' => $paths, + 'logo' => base_path() . (isset($logo) ? $logo : 'themes/garland/minnelli/logo.png'), + 'site_title' => variable_get('site_name', t('Drupal')), 'title' => drupal_get_title(), 'messages' => $show_messages ? theme('status_messages') : '', 'content' => $content, ); - $output = theme_render_template('misc/maintenance.tpl.php', $variables); - - return $output; + return theme_render_template($template, $variables); } /** Index: misc/maintenance.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/misc/maintenance.tpl.php,v retrieving revision 1.5 diff -u -p -r1.5 maintenance.tpl.php --- misc/maintenance.tpl.php 1 Sep 2007 05:42:48 -0000 1.5 +++ misc/maintenance.tpl.php 17 Sep 2007 17:12:11 -0000 @@ -1,6 +1,45 @@ +
@@ -8,9 +47,8 @@ -