From 404eeff6901ad0b7179ebdd892fbaa88132256f2 Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Wed, 2 Feb 2022 14:10:52 +0800 Subject: [PATCH] MDL-73532 theme_boost: Display the course name in single activity format The module context header will display the full name of the course when the course is using the single activity format header. --- theme/boost/classes/output/core_renderer.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/theme/boost/classes/output/core_renderer.php b/theme/boost/classes/output/core_renderer.php index e207ae391de..b01ba4138d5 100644 --- a/theme/boost/classes/output/core_renderer.php +++ b/theme/boost/classes/output/core_renderer.php @@ -150,13 +150,17 @@ class core_renderer extends \core_renderer { $prefix = null; if ($context->contextlevel == CONTEXT_MODULE) { - $heading = $this->page->cm->get_formatted_name(); - $imagedata = $this->pix_icon('icon', '', $this->page->activityname, ['class' => 'activityicon']); - $purposeclass = plugin_supports('mod', $this->page->activityname, FEATURE_MOD_PURPOSE); - $purposeclass .= ' activityiconcontainer'; - $purposeclass .= ' modicon_' . $this->page->activityname; - $imagedata = html_writer::tag('div', $imagedata, ['class' => $purposeclass]); - $prefix = get_string('modulename', $this->page->activityname); + if ($this->page->course->format === 'singleactivity') { + $heading = $this->page->course->fullname; + } else { + $heading = $this->page->cm->get_formatted_name(); + $imagedata = $this->pix_icon('icon', '', $this->page->activityname, ['class' => 'activityicon']); + $purposeclass = plugin_supports('mod', $this->page->activityname, FEATURE_MOD_PURPOSE); + $purposeclass .= ' activityiconcontainer'; + $purposeclass .= ' modicon_' . $this->page->activityname; + $imagedata = html_writer::tag('div', $imagedata, ['class' => $purposeclass]); + $prefix = get_string('modulename', $this->page->activityname); + } }