From f58e757901461fab33dba92030420c7b0d477dfc Mon Sep 17 00:00:00 2001 From: Gareth Barnard <1058419+gjb2048@users.noreply.github.com> Date: Wed, 2 Jan 2019 11:44:38 +0000 Subject: [PATCH] Fix: Administration / Naviagtion menu still appearing when flat navigation is on because they are not in the side-pre region. --- CHANGES.txt | 1 + classes/output/core_renderer.php | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index fbaacdae..c9be1bf9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,7 @@ New in 3.6.0.2 ============== - FIX: Participants menu only on course and module pages. - FIX: Style improvements to messages. +- FIX: Administration / Naviagtion menu still appearing when flat navigation is on because they are not in the side-pre region. - NEW: Show / hide the participants menu with the 'participantsmenu' setting in the 'Header' settings. New in 3.6.0.1 diff --git a/classes/output/core_renderer.php b/classes/output/core_renderer.php index 78ff586f..51f9db27 100644 --- a/classes/output/core_renderer.php +++ b/classes/output/core_renderer.php @@ -2132,14 +2132,13 @@ public function essential_blocks($region, $classes = array(), $tag = 'aside', $b ); $regioncontent = ''; - $flatnavigation = false; + $flatnavigation = (!empty(\theme_essential\toolbox::get_setting('flatnavigation'))); $flatnavigationcontent = ''; - if ((\theme_essential\toolbox::get_setting('flatnavigation')) && ($region == 'side-pre')) { + if (($flatnavigation) && ($region == 'side-pre')) { global $PAGE; $templatecontext = array('flatnavigation' => $PAGE->flatnav); $flatnavigationcontent = $this->render_from_template('theme_essential/flat_navigation', $templatecontext); $attributes['data-region'] = 'drawer'; - $flatnavigation = true; } $editing = $this->page->user_is_editing(); if ($editing) {