From 466a1713a087ea9ae1eaa5c4f53aae262debdd01 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 31 Mar 2016 15:06:37 +0800 Subject: [PATCH] MDL-52035 core: added ability to override pagelayout This is required by the LTI plugin when we share an activity. We do not want the user to be shown the navigation blocks etc. The activity should be the only thing displayed. --- lib/pagelib.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/pagelib.php b/lib/pagelib.php index acb6d315a91..20e85a7196d 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -1103,10 +1103,16 @@ class moodle_page { * @param string $pagelayout the page layout this is. For example 'popup', 'home'. */ public function set_pagelayout($pagelayout) { - // Uncomment this to debug theme pagelayout issues like missing blocks. - // if (!empty($this->_wherethemewasinitialised) && $pagelayout != $this->_pagelayout) - // debugging('Page layout has already been set and cannot be changed.', DEBUG_DEVELOPER); - $this->_pagelayout = $pagelayout; + global $SESSION; + + if (!empty($SESSION->forcepagelayout)) { + $this->_pagelayout = $SESSION->forcepagelayout; + } else { + // Uncomment this to debug theme pagelayout issues like missing blocks. + // if (!empty($this->_wherethemewasinitialised) && $pagelayout != $this->_pagelayout) + // debugging('Page layout has already been set and cannot be changed.', DEBUG_DEVELOPER); + $this->_pagelayout = $pagelayout; + } } /**