From cc3f17d86d232e7b122e714bcd339d78a3ad23c2 Mon Sep 17 00:00:00 2001 From: Mary Evans Date: Fri, 12 Oct 2012 22:57:39 +0100 Subject: [PATCH] MDL-35986 theme_canvas: add custommenu and block-region to layout files general.php, frontpage.php and report.php to fix regression in theme/serenity since MDL-33110. --- theme/canvas/layout/frontpage.php | 125 ++++++++++++++++-------------- theme/canvas/layout/general.php | 30 +++++-- theme/canvas/layout/report.php | 24 ++++-- 3 files changed, 106 insertions(+), 73 deletions(-) diff --git a/theme/canvas/layout/frontpage.php b/theme/canvas/layout/frontpage.php index a8b573d1f0a..c2d54c8ec20 100644 --- a/theme/canvas/layout/frontpage.php +++ b/theme/canvas/layout/frontpage.php @@ -1,19 +1,24 @@ heading); -$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar()); -$hasfooter = (empty($PAGE->layout_options['nofooter'])); $hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT); $hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT); +$showsidepre = $hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT); +$showsidepost = $hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT); + +$custommenu = $OUTPUT->custom_menu(); +$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu)); $bodyclasses = array(); -if ($hassidepre && !$hassidepost) { +if ($showsidepre && !$showsidepost) { $bodyclasses[] = 'side-pre-only'; -} else if ($hassidepost && !$hassidepre) { +} else if ($showsidepost && !$showsidepre) { $bodyclasses[] = 'side-post-only'; -} else if (!$hassidepost && !$hassidepre) { +} else if (!$showsidepost && !$showsidepre) { $bodyclasses[] = 'content-only'; } +if ($hascustommenu) { + $bodyclasses[] = 'has_custom_menu'; +} echo $OUTPUT->doctype() ?> htmlattributes() ?>> @@ -30,20 +35,24 @@ echo $OUTPUT->doctype() ?> -
+
- + + + +
+
@@ -51,60 +60,60 @@ echo $OUTPUT->doctype() ?> -
-
-
-
+
+
+
+
-
-
-
- main_content() ?> -
-
-
+
+
+
+ main_content() ?> +
+
+
- -
-
- blocks_for_region('side-pre') ?> -
-
- + +
+
+ blocks_for_region('side-pre') ?> +
+
+ - -
-
- blocks_for_region('side-post') ?> -
-
- + +
+
+ blocks_for_region('side-post') ?> +
+
+ -
-
-
-
+
+
+
+
- -
+
standard_end_of_body_html() ?> - \ No newline at end of file + diff --git a/theme/canvas/layout/general.php b/theme/canvas/layout/general.php index cda6005acd4..5261314a7e1 100644 --- a/theme/canvas/layout/general.php +++ b/theme/canvas/layout/general.php @@ -3,17 +3,27 @@ $hasheading = ($PAGE->heading); $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar()); $hasfooter = (empty($PAGE->layout_options['nofooter'])); -$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT); -$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT); +$hassidepre = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT)); +$hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-post', $OUTPUT)); +$haslogininfo = (empty($PAGE->layout_options['nologininfo'])); + +$showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT)); +$showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT)); + +$custommenu = $OUTPUT->custom_menu(); +$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu)); $bodyclasses = array(); -if ($hassidepre && !$hassidepost) { +if ($showsidepre && !$showsidepost) { $bodyclasses[] = 'side-pre-only'; -} else if ($hassidepost && !$hassidepre) { +} else if ($showsidepost && !$showsidepre) { $bodyclasses[] = 'side-post-only'; -} else if (!$hassidepost && !$hassidepre) { +} else if (!$showsidepost && !$showsidepre) { $bodyclasses[] = 'content-only'; } +if ($hascustommenu) { + $bodyclasses[] = 'has_custom_menu'; +} echo $OUTPUT->doctype() ?> htmlattributes() ?>> @@ -49,6 +59,10 @@ echo $OUTPUT->doctype() ?> + +
+ + -
+
blocks_for_region('side-pre') ?>
@@ -84,7 +98,7 @@ echo $OUTPUT->doctype() ?> -
+
blocks_for_region('side-post') ?>
@@ -119,4 +133,4 @@ echo $OUTPUT->doctype() ?> standard_end_of_body_html() ?> - \ No newline at end of file + diff --git a/theme/canvas/layout/report.php b/theme/canvas/layout/report.php index fce6e89e427..06607e310f8 100644 --- a/theme/canvas/layout/report.php +++ b/theme/canvas/layout/report.php @@ -3,17 +3,23 @@ $hasheading = ($PAGE->heading); $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar()); $hasfooter = (empty($PAGE->layout_options['nofooter'])); -$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT); -$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT); +$hassidepre = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT)); +$haslogininfo = (empty($PAGE->layout_options['nologininfo'])); + +$showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT)); + +$custommenu = $OUTPUT->custom_menu(); +$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu)); $bodyclasses = array(); -if ($hassidepre && !$hassidepost) { +if ($showsidepre ) { $bodyclasses[] = 'side-pre-only'; -} else if ($hassidepost && !$hassidepre) { - $bodyclasses[] = 'side-post-only'; -} else if (!$hassidepost && !$hassidepre) { +} else { $bodyclasses[] = 'content-only'; } +if ($hascustommenu) { + $bodyclasses[] = 'has_custom_menu'; +} echo $OUTPUT->doctype() ?> htmlattributes() ?>> @@ -49,6 +55,10 @@ echo $OUTPUT->doctype() ?>
+ +
+ +