From ebc5ea980c6b2f86b2b1873283250c813fb3607c Thu, 1 Dec 2011 20:10:17 +0100
From: Bram Goffings <bramgoffings@gmail.com>
Date: Thu, 1 Dec 2011 20:09:58 +0100
Subject: [PATCH] maintenance page



diff --git a/core/includes/batch.inc b/core/includes/batch.inc
index 513a8f9..f115b15 100644
--- a/core/includes/batch.inc
+++ b/core/includes/batch.inc
@@ -190,7 +190,7 @@
     // the error message.
     ob_start();
     $fallback = $current_set['error_message'] . '<br />' . $batch['error_message'];
-    $fallback = theme('maintenance_page', array('content' => $fallback, 'show_messages' => FALSE));
+    $fallback = theme('maintenance', array('content' => $fallback, 'show_messages' => FALSE));
 
     // We strip the end of the page using a marker in the template, so any
     // additional HTML output by PHP shows up inside the page rather than below
diff --git a/core/includes/common.inc b/core/includes/common.inc
index c6a29b7..1eb6de5 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -2505,7 +2505,7 @@
         drupal_maintenance_theme();
         drupal_add_http_header('Status', '503 Service unavailable');
         drupal_set_title(t('Site under maintenance'));
-        print theme('maintenance_page', array('content' => filter_xss_admin(variable_get('maintenance_mode_message',
+        print theme('maintenance', array('content' => filter_xss_admin(variable_get('maintenance_mode_message',
           t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')))))));
         break;
     }
@@ -6598,9 +6598,9 @@
       'render element' => 'element',
     ),
     // From theme.maintenance.inc.
-    'maintenance_page' => array(
+    'maintenance' => array(
       'variables' => array('content' => NULL, 'show_messages' => TRUE),
-      'template' => 'maintenance-page',
+      'template' => 'maintenance',
     ),
     'update_page' => array(
       'variables' => array('content' => NULL, 'show_messages' => TRUE),
diff --git a/core/includes/errors.inc b/core/includes/errors.inc
index eaf2e21..ba66a90 100644
--- a/core/includes/errors.inc
+++ b/core/includes/errors.inc
@@ -250,7 +250,7 @@
       drupal_set_title(t('Error'));
       // We fallback to a maintenance page at this point, because the page generation
       // itself can generate errors.
-      print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.')));
+      print theme('maintenance', array('content' => t('The website encountered an unexpected error. Please try again later.')));
       exit;
     }
   }
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 902907a..820e871 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2375,7 +2375,7 @@
  * based on the current path.
  *
  * Any changes to variables in this preprocessor should also be changed inside
- * template_preprocess_maintenance_page() to keep all of them consistent.
+ * template_preprocess_maintenance() to keep all of them consistent.
  *
  * @see drupal_render_page()
  * @see template_process_page()
@@ -2550,19 +2550,19 @@
 
 /**
  * The variables array generated here is a mirror of template_preprocess_page().
- * This preprocessor will run its course when theme_maintenance_page() is
+ * This preprocessor will run its course when theme_maintenance() is
  * invoked.
  *
- * An alternate template file of "maintenance-page--offline.tpl.php" can be
+ * An alternate template file of "maintenance--offline.tpl.php" can be
  * used when the database is offline to hide errors and completely replace the
  * content.
  *
  * The $variables array contains the following arguments:
  * - $content
  *
- * @see maintenance-page.tpl.php
+ * @see maintenance.tpl.php
  */
-function template_preprocess_maintenance_page(&$variables) {
+function template_preprocess_maintenance(&$variables) {
   // Add favicon
   if (theme_get_setting('toggle_favicon')) {
     $favicon = theme_get_setting('favicon');
@@ -2570,13 +2570,8 @@
     drupal_add_html_head_link(array('rel' => 'shortcut icon', 'href' => drupal_strip_dangerous_protocols($favicon), 'type' => $type));
   }
 
-  global $theme;
-  // Retrieve the theme data to list all available regions.
-  $theme_data = list_themes();
-  $regions = $theme_data[$theme]->info['regions'];
-
-  // Get all region content set with drupal_add_region_content().
-  foreach (array_keys($regions) as $region) {
+  $regions = array('sidebar_first', 'sidebar_second', 'content', 'page_top', 'page_bottom');
+  foreach($regions as $region) {
     // Assign region to a region variable.
     $region_content = drupal_get_region_content($region);
     isset($variables[$region]) ? $variables[$region] .= $region_content : $variables[$region] = $region_content;
@@ -2610,20 +2605,13 @@
 
   $variables['head_title_array']  = $head_title;
   $variables['head_title']        = implode(' | ', $head_title);
-  $variables['base_path']         = base_path();
   $variables['front_page']        = url();
-  $variables['breadcrumb']        = '';
-  $variables['feed_icons']        = '';
   $variables['help']              = '';
   $variables['language']          = $language;
-  $variables['language']->dir     = $language->direction ? 'rtl' : 'ltr';
   $variables['logo']              = theme_get_setting('logo');
   $variables['messages']          = $variables['show_messages'] ? theme('status_messages') : '';
-  $variables['main_menu']         = array();
-  $variables['secondary_menu']    = array();
   $variables['site_name']         = (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : '');
   $variables['site_slogan']       = (theme_get_setting('toggle_slogan') ? variable_get('site_slogan', '') : '');
-  $variables['tabs']              = '';
   $variables['title']             = drupal_get_title();
 
   // Compile a list of classes that are going to be applied to the body element.
@@ -2641,20 +2629,32 @@
     $variables['classes_array'][] = 'one-sidebar sidebar-' . $variables['layout'];
   }
 
+  // Initializes attributes which are specific to the html and body elements.
+  $variables['html_attributes_array'] = array();
+  $variables['body_attributes_array'] = array();
+
+  // HTML element attributes.
+  $variables['html_attributes_array']['lang'] = $language->language;
+  $variables['html_attributes_array']['dir'] = $language->direction ? 'rtl' : 'ltr';
+
   // Dead databases will show error messages so supplying this template will
   // allow themers to override the page and the content completely.
   if (isset($variables['db_is_active']) && !$variables['db_is_active']) {
-    $variables['theme_hook_suggestion'] = 'maintenance_page__offline';
+    $variables['theme_hook_suggestion'] = 'maintenance__offline';
   }
 }
 
 /**
  * The variables array generated here is a mirror of template_process_html().
- * This processor will run its course when theme_maintenance_page() is invoked.
+ * This processor will run its course when theme_maintenance() is invoked.
  *
- * @see maintenance-page.tpl.php
+ * @see maintenance.tpl.php
  */
-function template_process_maintenance_page(&$variables) {
+function template_process_maintenance(&$variables) {
+  // Flatten out html_attributes and body_attributes.
+  $variables['html_attributes'] = drupal_attributes($variables['html_attributes_array']);
+  $variables['body_attributes'] = drupal_attributes($variables['body_attributes_array']);
+
   $variables['head']    = drupal_get_html_head();
   $variables['css']     = drupal_add_css();
   $variables['styles']  = drupal_get_css();
diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc
index d663d14..8b18933 100644
--- a/core/includes/theme.maintenance.inc
+++ b/core/includes/theme.maintenance.inc
@@ -138,7 +138,7 @@
  */
 function theme_install_page($variables) {
   drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
-  return theme('maintenance_page', $variables);
+  return theme('maintenance', $variables);
 }
 
 /**
@@ -154,7 +154,7 @@
  */
 function theme_update_page($variables) {
   drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
-  return theme('maintenance_page', $variables);
+  return theme('maintenance', $variables);
 }
 
 /**
diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module
index 5433d3e..96ddc58 100644
--- a/core/modules/overlay/overlay.module
+++ b/core/modules/overlay/overlay.module
@@ -458,14 +458,14 @@
 }
 
 /**
- * Implements hook_preprocess_maintenance_page().
+ * Implements hook_preprocess_maintenance().
  *
  * If the current page request is inside the overlay, add appropriate classes
  * to the <body> element, and simplify the page title.
  *
- * @see overlay_preprocess_maintenance_page()
+ * @see overlay_preprocess_maintenance()
  */
-function overlay_preprocess_maintenance_page(&$variables) {
+function overlay_preprocess_maintenance(&$variables) {
   overlay_preprocess_html($variables);
 }
 
diff --git a/core/modules/system/maintenance-page.tpl.php b/core/modules/system/maintenance-page.tpl.php
deleted file mode 100644
index 31de3bb..0000000
--- a/core/modules/system/maintenance-page.tpl.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-
-/**
- * @file
- * Default theme implementation to display a single Drupal page while offline.
- *
- * All the available variables are mirrored in html.tpl.php and page.tpl.php.
- * Some may be blank but they are provided for consistency.
- *
- * @see template_preprocess()
- * @see template_preprocess_maintenance_page()
- */
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
-
-<head>
-  <title><?php print $head_title; ?></title>
-  <?php print $head; ?>
-  <?php print $styles; ?>
-  <?php print $scripts; ?>
-</head>
-<body class="<?php print $classes; ?>">
-  <div id="page">
-    <div id="header">
-      <div id="logo-title">
-
-        <?php if (!empty($logo)): ?>
-          <a href="<?php print $base_path; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
-            <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
-          </a>
-        <?php endif; ?>
-
-        <div id="name-and-slogan">
-          <?php if (!empty($site_name)): ?>
-            <h1 id="site-name">
-              <a href="<?php print $base_path ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
-            </h1>
-          <?php endif; ?>
-
-          <?php if (!empty($site_slogan)): ?>
-            <div id="site-slogan"><?php print $site_slogan; ?></div>
-          <?php endif; ?>
-        </div> <!-- /name-and-slogan -->
-      </div> <!-- /logo-title -->
-
-      <?php if (!empty($header)): ?>
-        <div id="header-region">
-          <?php print $header; ?>
-        </div>
-      <?php endif; ?>
-
-    </div> <!-- /header -->
-
-    <div id="container" class="clearfix">
-
-      <?php if (!empty($sidebar_first)): ?>
-        <div id="sidebar-first" class="column sidebar">
-          <?php print $sidebar_first; ?>
-        </div> <!-- /sidebar-first -->
-      <?php endif; ?>
-
-      <div id="main" class="column"><div id="main-squeeze">
-
-        <div id="content">
-          <?php if (!empty($title)): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
-          <?php if (!empty($messages)): print $messages; endif; ?>
-          <div id="content-content" class="clearfix">
-            <?php print $content; ?>
-          </div> <!-- /content-content -->
-        </div> <!-- /content -->
-
-      </div></div> <!-- /main-squeeze /main -->
-
-      <?php if (!empty($sidebar_second)): ?>
-        <div id="sidebar-second" class="column sidebar">
-          <?php print $sidebar_second; ?>
-        </div> <!-- /sidebar-second -->
-      <?php endif; ?>
-
-    </div> <!-- /container -->
-
-    <div id="footer-wrapper">
-      <div id="footer">
-        <?php if (!empty($footer)): print $footer; endif; ?>
-      </div> <!-- /footer -->
-    </div> <!-- /footer-wrapper -->
-
-  </div> <!-- /page -->
-
-</body>
-</html>
diff --git a/core/modules/system/maintenance.tpl.php b/core/modules/system/maintenance.tpl.php
new file mode 100644
index 0000000..ccc5cad
--- /dev/null
+++ b/core/modules/system/maintenance.tpl.php
@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * @file
+ * Default theme implementation to display a single Drupal page while offline.
+ *
+ * All the available variables are mirrored in html.tpl.php and page.tpl.php.
+ * Some may be blank but they are provided for consistency.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_maintenance()
+ */
+?><!DOCTYPE html>
+<html<?php print $html_attributes; ?>>
+ <head>
+   <title><?php print $head_title; ?></title>
+   <?php print $head; ?>
+   <?php print $styles; ?>
+   <?php print $scripts; ?>
+ </head>
+ <body class="<?php print $classes; ?>"<?php print $body_attributes; ?>>
+   <div id="page">
+    <header id="header" role="banner">
+
+      <?php if ($logo): ?>
+        <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
+          <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
+        </a>
+      <?php endif; ?>
+
+      <?php if ($site_name || $site_slogan): ?>
+         <div id="name-and-slogan">
+          <?php if ($site_name): ?>
+            <?php if ($title): ?>
+              <p id="site-name"><strong>
+                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
+              </strong></p>
+            <?php else: /* Use h1 when the content title is empty */ ?>
+              <h1 id="site-name">
+                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
+              </h1>
+            <?php endif; ?>
+           <?php endif; ?>
+
+          <?php if ($site_slogan): ?>
+            <p id="site-slogan"><?php print $site_slogan; ?></p>
+           <?php endif; ?>
+        </div><!-- #name-and-slogan -->
+       <?php endif; ?>
+
+      <?php print render($page['header']); ?>
+
+    </header>
+
+    <?php if ($messages): ?>
+      <div id="messages"><?php print $messages; ?></div>
+    <?php endif; ?>
+
+    <div id="main" role="main" class="clearfix">
+
+      <div id="content" class="column">
+        <?php print render($title_prefix); ?>
+        <?php if (!empty($title)): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
+        <?php print render($title_suffix); ?>
+        <?php print $content; ?>
+      </div><!-- #content -->
+
+      <?php if (!empty($page['sidebar_first'])): ?>
+        <div id="sidebar-first" class="column sidebar">
+          <?php print render($page['sidebar_first']); ?>
+        </div><!-- #sidebar-first -->
+      <?php endif; ?>
+
+      <?php if (!empty($page['sidebar_second'])): ?>
+         <div id="sidebar-second" class="column sidebar">
+          <?php print render($page['sidebar_second']); ?>
+        </div><!-- #sidebar-second -->
+       <?php endif; ?>
+
+    </div><!-- #main -->
+
+    <footer id="footer" role="contentinfo">
+      <?php print render($page['footer']); ?>
+    </footer>
+
+  </div><!-- #page -->
+
+ </body>
+</html>
diff --git a/core/themes/bartik/css/maintenance-page.css b/core/themes/bartik/css/maintenance-page.css
deleted file mode 100644
index c13c77b..0000000
--- a/core/themes/bartik/css/maintenance-page.css
+++ /dev/null
@@ -1,67 +0,0 @@
-
-body.maintenance-page {
-  background-color: #fff;
-  color: #000;
-}
-.maintenance-page #page-wrapper {
-  background: #fff;
-  margin-left: auto;
-  margin-right: auto;
-  min-width: 0;
-  min-height: 0;
-  width: 800px;
-  border: 1px solid #ddd;
-  margin-top: 40px;
-}
-.maintenance-page #page {
-  margin: 20px 40px 40px;
-}
-.maintenance-page #main-wrapper {
-  min-height: inherit;
-}
-.maintenance-page #header,
-.maintenance-page #messages,
-.maintenance-page #main {
-  width: auto;
-}
-.maintenance-page #header div.section,
-.maintenance-page #main {
-  width: 700px;
-}
-.maintenance-page #main {
-  margin: 0;
-}
-.maintenance-page #content .section {
-  padding: 0 0 0 10px;
-}
-.maintenance-page #header {
-  background-color: #fff;
-  background-image: none;
-}
-.maintenance-page #name-and-slogan {
-  margin-bottom: 50px;
-  margin-left: 0;
-  padding-top: 20px;
-  font-size: 90%;
-}
-.maintenance-page #name-and-slogan,
-.maintenance-page #name-and-slogan a,
-.maintenance-page #name-and-slogan a:hover,
-.maintenance-page #name-and-slogan a:hover {
-  color: #777;
-}
-.maintenance-page  h1#page-title {
-  line-height: 1em;
-  margin-top: 0;
-}
-.maintenance-page #messages {
-  padding: 0;
-  margin-top: 30px;
-}
-.maintenance-page #messages div.messages {
-  margin: 0;
-}
-.maintenance-page #messages div.section {
-  padding: 0;
-  width: auto;
-}
diff --git a/core/themes/bartik/css/maintenance.css b/core/themes/bartik/css/maintenance.css
new file mode 100644
index 0000000..9bbad61
--- /dev/null
+++ b/core/themes/bartik/css/maintenance.css
@@ -0,0 +1,67 @@
+
+body.maintenance {
+  background-color: #fff;
+  color: #000;
+}
+.maintenance #page-wrapper {
+  background: #fff;
+  margin-left: auto;
+  margin-right: auto;
+  min-width: 0;
+  min-height: 0;
+  width: 800px;
+  border: 1px solid #ddd;
+  margin-top: 40px;
+}
+.maintenance #page {
+  margin: 20px 40px 40px;
+}
+.maintenance #main-wrapper {
+  min-height: inherit;
+}
+.maintenance #header,
+.maintenance #messages,
+.maintenance #main {
+  width: auto;
+}
+.maintenance #header div.section,
+.maintenance #main {
+  width: 700px;
+}
+.maintenance #main {
+  margin: 0;
+}
+.maintenance #content .section {
+  padding: 0 0 0 10px;
+}
+.maintenance #header {
+  background-color: #fff;
+  background-image: none;
+}
+.maintenance #name-and-slogan {
+  margin-bottom: 50px;
+  margin-left: 0;
+  padding-top: 20px;
+  font-size: 90%;
+}
+.maintenance #name-and-slogan,
+.maintenance #name-and-slogan a,
+.maintenance #name-and-slogan a:hover,
+.maintenance #name-and-slogan a:hover {
+  color: #777;
+}
+.maintenance  h1#page-title {
+  line-height: 1em;
+  margin-top: 0;
+}
+.maintenance #messages {
+  padding: 0;
+  margin-top: 30px;
+}
+.maintenance #messages div.messages {
+  margin: 0;
+}
+.maintenance #messages div.section {
+  padding: 0;
+  width: auto;
+}
diff --git a/core/themes/bartik/template.php b/core/themes/bartik/template.php
index 8d2b8c4..c533d83 100644
--- a/core/themes/bartik/template.php
+++ b/core/themes/bartik/template.php
@@ -73,19 +73,19 @@
 }
 
 /**
- * Implements hook_preprocess_maintenance_page().
+ * Implements hook_preprocess_maintenance().
  */
-function bartik_preprocess_maintenance_page(&$variables) {
+function bartik_preprocess_maintenance(&$variables) {
   if (!$variables['db_is_active']) {
     unset($variables['site_name']);
   }
-  drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css');
+  drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance.css');
 }
 
 /**
  * Override or insert variables into the maintenance page template.
  */
-function bartik_process_maintenance_page(&$variables) {
+function bartik_process_maintenance(&$variables) {
   // Always print the site name and slogan, but if they are toggled off, we'll
   // just hide them visually.
   $variables['hide_site_name']   = theme_get_setting('toggle_name') ? FALSE : TRUE;
diff --git a/core/themes/bartik/templates/maintenance-page.tpl.php b/core/themes/bartik/templates/maintenance-page.tpl.php
deleted file mode 100644
index 6deef1e..0000000
--- a/core/themes/bartik/templates/maintenance-page.tpl.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-/**
- * @file
- * Implementation to display a single Drupal page while offline.
- *
- * All the available variables are mirrored in page.tpl.php.
- *
- * @see template_preprocess()
- * @see template_preprocess_maintenance_page()
- * @see bartik_process_maintenance_page()
- */
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">
-<head>
-  <?php print $head; ?>
-  <title><?php print $head_title; ?></title>
-  <?php print $styles; ?>
-  <?php print $scripts; ?>
-</head>
-<body class="<?php print $classes; ?>" <?php print $attributes;?>>
-
-  <div id="skip-link">
-    <a href="#main-content" class="element-invisible element-focusable"><?php print t('Skip to main content'); ?></a>
-  </div>
-
-  <div id="page-wrapper"><div id="page">
-
-    <div id="header"><div class="section clearfix">
-      <?php if ($site_name || $site_slogan): ?>
-        <div id="name-and-slogan"<?php if ($hide_site_name && $hide_site_slogan) { print ' class="element-invisible"'; } ?>>
-          <?php if ($site_name): ?>
-            <div id="site-name"<?php if ($hide_site_name) { print ' class="element-invisible"'; } ?>>
-              <strong>
-                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
-              </strong>
-            </div>
-          <?php endif; ?>
-          <?php if ($site_slogan): ?>
-            <div id="site-slogan"<?php if ($hide_site_slogan) { print ' class="element-invisible"'; } ?>>
-              <?php print $site_slogan; ?>
-            </div>
-          <?php endif; ?>
-        </div> <!-- /#name-and-slogan -->
-      <?php endif; ?>
-    </div></div> <!-- /.section, /#header -->
-
-    <div id="main-wrapper"><div id="main" class="clearfix">
-      <div id="content" class="column"><div class="section">
-        <a id="main-content"></a>
-        <?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
-        <?php print $content; ?>
-        <?php if ($messages): ?>
-          <div id="messages"><div class="section clearfix">
-            <?php print $messages; ?>
-          </div></div> <!-- /.section, /#messages -->
-        <?php endif; ?>
-      </div></div> <!-- /.section, /#content -->
-    </div></div> <!-- /#main, /#main-wrapper -->
-
-  </div></div> <!-- /#page, /#page-wrapper -->
-
-</body>
-</html>
diff --git a/core/themes/seven/maintenance-page.tpl.php b/core/themes/seven/maintenance-page.tpl.php
deleted file mode 100644
index aeef310..0000000
--- a/core/themes/seven/maintenance-page.tpl.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
-  <head>
-    <title><?php print $head_title; ?></title>
-    <?php print $head; ?>
-    <?php print $styles; ?>
-    <?php print $scripts; ?>
-  </head>
-  <body class="<?php print $classes; ?>">
-
-  <?php print $page_top; ?>
-
-  <div id="branding">
-    <?php if ($title): ?><h1 class="page-title"><?php print $title; ?></h1><?php endif; ?>
-  </div>
-
-  <div id="page">
-
-    <?php if ($sidebar_first): ?>
-      <div id="sidebar-first" class="sidebar">
-        <?php if ($logo): ?>
-          <img id="logo" src="<?php print $logo ?>" alt="<?php print $site_name ?>" />
-        <?php endif; ?>
-        <?php print $sidebar_first ?>
-      </div>
-    <?php endif; ?>
-
-    <div id="content" class="clearfix">
-      <?php if ($messages): ?>
-        <div id="console"><?php print $messages; ?></div>
-      <?php endif; ?>
-      <?php if ($help): ?>
-        <div id="help">
-          <?php print $help; ?>
-        </div>
-      <?php endif; ?>
-      <?php print $content; ?>
-    </div>
-
-  </div>
-
-  <?php print $page_bottom; ?>
-
-  </body>
-</html>
diff --git a/core/themes/seven/maintenance.tpl.php b/core/themes/seven/maintenance.tpl.php
new file mode 100644
index 0000000..2125a60
--- /dev/null
+++ b/core/themes/seven/maintenance.tpl.php
@@ -0,0 +1,46 @@
+<?php
+?><!DOCTYPE html>
+<html<?php print $html_attributes; ?>>
+<head>
+    <title><?php print $head_title; ?></title>
+    <?php print $head; ?>
+    <?php print $styles; ?>
+    <?php print $scripts; ?>
+  </head>
+  <body class="<?php print $classes; ?>">
+
+  <?php print $page_top; ?>
+
+  <div id="branding">
+    <?php if ($title): ?><h1 class="page-title"><?php print $title; ?></h1><?php endif; ?>
+  </div>
+
+  <div id="page">
+
+    <?php if ($sidebar_first): ?>
+      <div id="sidebar-first" class="sidebar">
+        <?php if ($logo): ?>
+          <img id="logo" src="<?php print $logo ?>" alt="<?php print $site_name ?>" />
+        <?php endif; ?>
+        <?php print $sidebar_first ?>
+      </div>
+    <?php endif; ?>
+
+    <div id="content" class="clearfix">
+      <?php if ($messages): ?>
+        <div id="console"><?php print $messages; ?></div>
+      <?php endif; ?>
+      <?php if ($help): ?>
+        <div id="help">
+          <?php print $help; ?>
+        </div>
+      <?php endif; ?>
+      <?php print $content; ?>
+    </div>
+
+  </div>
+
+  <?php print $page_bottom; ?>
+
+  </body>
+</html>
diff --git a/core/themes/seven/template.php b/core/themes/seven/template.php
index 9804d4d..9086b0a 100644
--- a/core/themes/seven/template.php
+++ b/core/themes/seven/template.php
@@ -1,12 +1,12 @@
 <?php
 
 /**
- * Override or insert variables into the maintenance page template.
+ * Override or insert variables into the maintenance template.
  */
-function seven_preprocess_maintenance_page(&$vars) {
+function seven_preprocess_maintenance(&$vars) {
   // While markup for normal pages is split into page.tpl.php and html.tpl.php,
   // the markup for the maintenance page is all in the single
-  // maintenance-page.tpl.php template. So, to have what's done in
+  // maintenance.tpl.php template. So, to have what's done in
   // seven_preprocess_html() also happen on the maintenance page, it has to be
   // called here.
   seven_preprocess_html($vars);
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 360e556..b8d154e 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -339,7 +339,7 @@
  * is explicitly set to maintenance mode through the administration page or when
  * the database is inactive due to an error. It can be set through the
  * 'maintenance_theme' key. The template file should also be copied into the
- * theme. It is located inside 'core/modules/system/maintenance-page.tpl.php'.
+ * theme. It is located inside 'core/modules/system/maintenance.tpl.php'.
  * Note: This setting does not apply to installation and update pages.
  */
 # $conf['maintenance_theme'] = 'bartik';
