From cc182408aadfa210fbc8fa17b8d885aeefba02b5 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 3 May 2022 09:53:57 +0800 Subject: [PATCH] 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 }}}