From 6ec03311499f902560c3d8bc2bde1f3ad30ef0ff Mon Sep 17 00:00:00 2001 From: Jesse Hofmann-Smith Date: Thu, 13 Mar 2014 17:31:51 -0700 Subject: [PATCH] fix JS error by moving maintenance page to new page --- styleguide.module | 17 +++++++++++++++++ styleguide.styleguide.inc | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/styleguide.module b/styleguide.module index dd50176..c6936d5 100644 --- a/styleguide.module +++ b/styleguide.module @@ -47,10 +47,27 @@ function styleguide_menu() { 'theme arguments' => array($theme->name), ); } + // The maintenance page theme function returns a full HTML document with + // doctype. It must be rendered on its own page. Currently there isn't a way + // to display the maintenance page using a theme other than the default. + $items['admin/appearance/styleguide/maintenance-page'] = array( + 'title' => 'Style guide | Maintenance page', + 'page callback' => 'styleguide_maintenance_page', + 'access arguments' => array('view style guides'), + 'type' => MENU_CALLBACK, + ); + return $items; } /** + * Menu callback to display the maintenance page. + */ +function styleguide_maintenance_page() { + print theme('maintenance_page', array('content' => styleguide_paragraph(2))); +} + +/** * Implements hook_admin_paths(). */ function styleguide_admin_paths() { diff --git a/styleguide.styleguide.inc b/styleguide.styleguide.inc index f02d79c..ae1fa9f 100644 --- a/styleguide.styleguide.inc +++ b/styleguide.styleguide.inc @@ -263,7 +263,7 @@ function styleguide_styleguide() { // This item kills drupal_set_message. The messages are displayed here. $items['maintenance_page'] = array( 'title' => t('Maintenance page'), - 'content' => theme('maintenance_page', array('content' => styleguide_paragraph(2))), + 'content' => l(t('See full page'), 'admin/appearance/styleguide/maintenance-page') . '', 'group' => t('System') ); $items['system_powered_by'] = array( -- 1.8.3.4 (Apple Git-47)