From e45ef9ec88564592ffc844e4a4d9e0791eb306f7 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Tue, 1 Oct 2013 17:06:16 +1300 Subject: [PATCH] MDL-41398 bootstrap: added a maintenance layout --- theme/bootstrapbase/config.php | 7 ++- theme/bootstrapbase/layout/maintenance.php | 62 ++++++++++++++++++++++ theme/bootstrapbase/upgrade.txt | 9 ++++ theme/clean/layout/maintenance.php | 55 +++++++++++++++++++ theme/upgrade.txt | 5 ++ 5 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 theme/bootstrapbase/layout/maintenance.php create mode 100644 theme/bootstrapbase/upgrade.txt create mode 100644 theme/clean/layout/maintenance.php diff --git a/theme/bootstrapbase/config.php b/theme/bootstrapbase/config.php index 8ddf89567a6..668fb562599 100644 --- a/theme/bootstrapbase/config.php +++ b/theme/bootstrapbase/config.php @@ -129,12 +129,11 @@ $THEME->layouts = array( 'regions' => array() ), // Used during upgrade and install, and for the 'This site is undergoing maintenance' message. - // This must not have any blocks, and it is good idea if it does not have links to - // other places - for example there should not be a home link in the footer... + // This must not have any blocks, links, or API calls that would lead to database or cache interaction. + // Please be extremely careful if you are modifying this layout. 'maintenance' => array( - 'file' => 'columns1.php', + 'file' => 'maintenance.php', 'regions' => array(), - 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocoursefooter'=>true, 'nocourseheader'=>true), ), // Should display the content and basic headers only. 'print' => array( diff --git a/theme/bootstrapbase/layout/maintenance.php b/theme/bootstrapbase/layout/maintenance.php new file mode 100644 index 00000000000..5b0b9f7ea1b --- /dev/null +++ b/theme/bootstrapbase/layout/maintenance.php @@ -0,0 +1,62 @@ +. + +/** + * This layout file is designed maintenance related tasks such as upgrade and installation of plugins. + * + * It's ultra important that this layout file makes no use of API's unless it absolutely needs to. + * Under no circumstances should it use API calls that result in database or cache interaction. + * + * If you are modifying this file please be extremely careful, one wrong API call and you could end up + * breaking installation or upgrade unwittingly. + */ + +echo $OUTPUT->doctype() ?> +htmlattributes(); ?>> + + <?php echo $OUTPUT->page_title(); ?> + + standard_head_html() ?> + + + +body_attributes(); ?>> + +standard_top_of_body_html() ?> + +
+ + + +
+
+ main_content(); ?> +
+
+ +
+ standard_footer_html(); + ?> +
+ + standard_end_of_body_html() ?> + +
+ + diff --git a/theme/bootstrapbase/upgrade.txt b/theme/bootstrapbase/upgrade.txt new file mode 100644 index 00000000000..6f2fc38eff4 --- /dev/null +++ b/theme/bootstrapbase/upgrade.txt @@ -0,0 +1,9 @@ +This file describes API changes in /theme/bootstrapbase +information provided here is intended especially for theme designers. + +=== 2.5.3 === +Notes: +* A new maintenance layout file was introduced. + If you have a theme based upon bootstrapbase that implements its own layouts but + does not define the maintenance layout in its config.php then you may want to + create your own maintenance layout file and apply your customisations to that. diff --git a/theme/clean/layout/maintenance.php b/theme/clean/layout/maintenance.php new file mode 100644 index 00000000000..b483a430355 --- /dev/null +++ b/theme/clean/layout/maintenance.php @@ -0,0 +1,55 @@ +. + +// Get the HTML for the settings bits. +$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE); + +echo $OUTPUT->doctype() ?> +htmlattributes(); ?>> + + <?php echo $OUTPUT->page_title(); ?> + + standard_head_html() ?> + + + +body_attributes(); ?>> + +standard_top_of_body_html() ?> + +
+ + + +
+
+ main_content(); ?> +
+
+ +
+ standard_footer_html(); + ?> +
+ + standard_end_of_body_html() ?> + +
+ + diff --git a/theme/upgrade.txt b/theme/upgrade.txt index 4da7f44f47e..4859734b3be 100644 --- a/theme/upgrade.txt +++ b/theme/upgrade.txt @@ -1,6 +1,11 @@ This files describes API changes in /theme/* themes, information provided here is intended especially for theme designer. +=== 2.5.3 === + +Notes: +* For themes based on bootstrapbase please also read theme/bootstrapbase/upgrade.txt + === 2.5.1 === Notes: