diff --git a/CHANGES.txt b/CHANGES.txt index 84e4cb53..55ef138f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,7 @@ New in 3.1.1.6 ============== - FIX: Issue #798: Slider title needs to support multi-lang filter. - FIX: Course category multi-lang, ref: https://moodle.org/mod/forum/discuss.php?d=344426#p1389008. +- NEW: Issue #734: Unable to disable the new "page top" block region. New in 3.1.1.5 ============== diff --git a/classes/toolbox.php b/classes/toolbox.php index 2bafb30e..a03af28b 100644 --- a/classes/toolbox.php +++ b/classes/toolbox.php @@ -158,7 +158,7 @@ static private function check_corerenderer() { global $PAGE; $corerenderer = null; try { - $corerenderer = $PAGE->get_renderer('theme_'.$PAGE->theme->name, 'core'); + $corerenderer = $PAGE->get_renderer('theme_'.$page->theme->name, 'core'); } catch (\coding_exception $ce) { // Specialised renderer may not exist in theme. This is not a coding fault. We just need to cope. $corerenderer = null; diff --git a/config.php b/config.php index 526792af..2dfc5fa8 100644 --- a/config.php +++ b/config.php @@ -72,13 +72,18 @@ $baseregions[] = 'header'; $fpaddregions[] = 'header'; } -$standardregions = array_merge(array('side-pre', 'page-top'), $baseregions); +$onecolumnregions = array_merge($baseregions); +$standardregions = array_merge(array('side-pre'), $baseregions); +if (get_config('theme_essential', 'pagetopblocks')) { + $onecolumnregions[] = 'page-top'; + $standardregions[] = 'page-top'; +} $THEME->layouts = array( // Most backwards compatible layout without the blocks - this is the layout used by default. 'base' => array( 'file' => 'columns1.php', - 'regions' => $baseregions, + 'regions' => $onecolumnregions, 'defaultregion' => 'footer-middle', ), // Front page. @@ -164,7 +169,7 @@ // Should display the content and basic headers only. 'print' => array( 'file' => 'columns1.php', - 'regions' => $baseregions, + 'regions' => $onecolumnregions, 'defaultregion' => '', 'options' => array('nofooter' => true), ), diff --git a/lang/en/theme_essential.php b/lang/en/theme_essential.php index 5c6a456b..a93b063f 100644 --- a/lang/en/theme_essential.php +++ b/lang/en/theme_essential.php @@ -168,8 +168,10 @@ $string['stylestretch'] = 'Stretch'; $string['styletiled'] = 'Tiled'; +$string['pagetopblocks'] = 'Enable additional page \'Page top\' blocks'; +$string['pagetopblocksdesc'] = 'If enabled this will display an additional block location beside the side blocks and above the content area on all pages except the \'Front page\' which has its own setting. Note: The number of blocks per row depends on the setting \'pagetopblocksperrow\'.'; $string['pagetopblocksperrow'] = 'Page top blocks per row'; -$string['pagetopblocksperrowdesc'] = 'State up to how many blocks per row between {$a->lower} and {$a->upper} for pages with \'Page top blocks\'. Current pages are: Admin, Course, Course Category, Dashboard, Frontpage, My Public.'; +$string['pagetopblocksperrowdesc'] = 'State up to how many blocks per row between {$a->lower} and {$a->upper} for pages with \'Page top blocks\'. Current pages are: Course, Course Category, Dashboard, My Public and Print.'; $string['pagebottomblocksperrow'] = 'Page bottom blocks per row'; $string['pagebottomblocksperrowdesc'] = 'State up to how many blocks per row between {$a->lower} and {$a->upper} for pages with \'Page bottom blocks\'. Current pages are: Admin, Course management, Grading and Quiz edit.'; @@ -455,9 +457,11 @@ $string['frontpagemiddleblocks'] = 'Enable additional front page \'Home\' (was \'Middle\') blocks'; $string['frontpagemiddleblocksdesc'] = 'If enabled this will display an additional block location just under the marketing spots.'; $string['frontpagehomeblocksperrow'] = 'Home (was \'Middle\') blocks per row'; -$string['frontpagehomeblocksperrowdesc'] = 'State up to how many blocks per row between {$a->lower} and {$a->upper} for the \'Home blocks\'.'; +$string['frontpagehomeblocksperrowdesc'] = 'State up to how many blocks per row between {$a->lower} and {$a->upper} for the \'Home blocks\' block region.'; $string['fppagetopblocks'] = 'Enable additional front page \'Page top\' blocks'; -$string['fppagetopblocksdesc'] = 'If enabled this will display an additional block location beside the side blocks and above the content area. Note: The number of blocks per row depends on the setting \'pagetopblocksperrow\'.'; +$string['fppagetopblocksdesc'] = 'If enabled this will display an additional block location beside the side blocks and above the content area. Note: The number of blocks per row depends on the setting \'fppagetopblocksperrow\'.'; +$string['fppagetopblocksperrow'] = 'Page top blocks per row'; +$string['fppagetopblocksperrowdesc'] = 'State up to how many blocks per row between {$a->lower} and {$a->upper} for the \'Page top\' block region on the front page.'; // Slideshow. $string['slideshowheading'] = 'Slide show'; diff --git a/layout/columns1.php b/layout/columns1.php index 4ce2a0ea..006d1f3d 100644 --- a/layout/columns1.php +++ b/layout/columns1.php @@ -33,12 +33,16 @@