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.
This commit is contained in:
Mark Nelson 2016-03-31 15:06:37 +08:00
parent 6c1342d7e5
commit 466a1713a0

View File

@ -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;
}
}
/**