From cc182408aadfa210fbc8fa17b8d885aeefba02b5 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 3 May 2022 09:53:57 +0800 Subject: [PATCH 1/5] MDL-74602 theme_boost: fix missing activity header in embedded layout The activity header, which includes things like dates and completion information, was moved out of the page $OUTPUT and into a separate template context variable in 4.0, meaning it was missing from any layout which didn't actively add it back to the page output. This fixes this problem for the embedded layout only by adding support for the activity header in the embedded template. --- theme/boost/layout/embedded.php | 2 ++ theme/boost/templates/embedded.mustache | 3 +++ 2 files changed, 5 insertions(+) diff --git a/theme/boost/layout/embedded.php b/theme/boost/layout/embedded.php index 762d7f3277c..f3ddd7fd3b5 100644 --- a/theme/boost/layout/embedded.php +++ b/theme/boost/layout/embedded.php @@ -26,9 +26,11 @@ defined('MOODLE_INTERNAL') || die(); $fakeblockshtml = $OUTPUT->blocks('side-pre', array(), 'aside', true); $hasfakeblocks = strpos($fakeblockshtml, 'data-block="_fake"') !== false; +$renderer = $PAGE->get_renderer('core'); $templatecontext = [ 'output' => $OUTPUT, + 'headercontent' => $PAGE->activityheader->export_for_template($renderer), 'hasfakeblocks' => $hasfakeblocks, 'fakeblocks' => $fakeblockshtml, ]; diff --git a/theme/boost/templates/embedded.mustache b/theme/boost/templates/embedded.mustache index a9a419f03e9..ab390c5a0a0 100644 --- a/theme/boost/templates/embedded.mustache +++ b/theme/boost/templates/embedded.mustache @@ -61,6 +61,9 @@ {{/hasfakeblocks}}
+ {{#headercontent}} + {{> core/activity_header }} + {{/headercontent}} {{{ output.main_content }}}
From 4f7bd72f7212b112a21cf41a18c9fc3db3e54e14 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 3 May 2022 09:55:22 +0800 Subject: [PATCH 2/5] MDL-74602 mod_assign: disable activity header on embedded grader page --- mod/assign/locallib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 5c0d9a85c18..b88cc9e86f9 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -4756,6 +4756,8 @@ class assign { // Need submit permission to submit an assignment. $this->require_view_grades(); + $PAGE->activityheader->disable(); + $PAGE->set_pagelayout('embedded'); $courseshortname = $this->get_context()->get_course_context()->get_context_name(false, true); From 0d3a2c9181448c52ab3d5b6e60e1f4049a9c7cef Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 3 May 2022 09:56:56 +0800 Subject: [PATCH 3/5] MDL-74602 mod_book: disable activity header on book print page --- mod/book/tool/print/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/book/tool/print/index.php b/mod/book/tool/print/index.php index d898d1905da..0af9308dcdd 100644 --- a/mod/book/tool/print/index.php +++ b/mod/book/tool/print/index.php @@ -54,6 +54,7 @@ if ($chapterid) { $PAGE->set_url('/mod/book/print.php', array('id' => $id, 'chapterid' => $chapterid)); +$PAGE->activityheader->disable(); $PAGE->set_pagelayout("embedded"); unset($id); @@ -93,4 +94,4 @@ if ($chapter) { echo $renderer->render($page); // Finish page output. -echo $OUTPUT->footer(); \ No newline at end of file +echo $OUTPUT->footer(); From 5fa19e43b3fc5f7e4c137f86b791ccb81b4fc604 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 3 May 2022 09:57:19 +0800 Subject: [PATCH 4/5] MDL-74602 mod_chat: disable activity header in ajax chat interface --- mod/chat/gui_ajax/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/chat/gui_ajax/index.php b/mod/chat/gui_ajax/index.php index 248f8b51eb6..eee084a8010 100644 --- a/mod/chat/gui_ajax/index.php +++ b/mod/chat/gui_ajax/index.php @@ -84,6 +84,7 @@ $PAGE->requires->js_init_call('M.mod_chat_ajax.init', array($modulecfg), false, $PAGE->set_title(get_string('modulename', 'chat').": $courseshortname: ".format_string($chat->name, true)."$groupname"); $PAGE->add_body_class('yui-skin-sam'); +$PAGE->activityheader->disable(); $PAGE->set_pagelayout('embedded'); if ( $theme != 'course_theme') { $PAGE->requires->css('/mod/chat/gui_ajax/theme/'.$theme.'/chat.css'); From 98dbb93589aaacf3c6f6b2b7ec6d71d61721cc14 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 3 May 2022 09:58:01 +0800 Subject: [PATCH 5/5] MDL-74602 mod_wiki: disable activity header in wiki print view --- mod/wiki/pagelib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/wiki/pagelib.php b/mod/wiki/pagelib.php index c5ea1697ee4..16b9e229185 100644 --- a/mod/wiki/pagelib.php +++ b/mod/wiki/pagelib.php @@ -2261,6 +2261,7 @@ class page_wiki_prettyview extends page_wiki { function __construct($wiki, $subwiki, $cm) { global $PAGE; $PAGE->set_pagelayout('embedded'); + $PAGE->activityheader->disable(); parent::__construct($wiki, $subwiki, $cm); }