diff --git a/course/format/classes/output/local/overview/activityname.php b/course/format/classes/output/local/overview/activityname.php index 6dce126d630..2f2754b9796 100644 --- a/course/format/classes/output/local/overview/activityname.php +++ b/course/format/classes/output/local/overview/activityname.php @@ -53,13 +53,17 @@ class activityname implements renderable, named_templatable { $section = $this->cm->get_section_info(); $course = $this->cm->get_course(); $format = course_format::instance($course); - return (object) [ + + $result = (object) [ 'activityname' => \core_external\util::format_string($cm->name, $cm->context, true), 'activityurl' => $cm->url, - 'sectiontitle' => $format->get_section_name($section), 'hidden' => empty($cm->visible), 'stealth' => $cm->is_stealth(), ]; + if ($format->uses_sections()) { + $result->sectiontitle = $format->get_section_name($section); + } + return $result; } /** diff --git a/course/format/templates/local/overview/activityname.mustache b/course/format/templates/local/overview/activityname.mustache index 7e4b30052f0..85ad16ffd0e 100644 --- a/course/format/templates/local/overview/activityname.mustache +++ b/course/format/templates/local/overview/activityname.mustache @@ -32,15 +32,23 @@
{{activityname}}
+ {{#sectiontitle}}
{{sectiontitle}}
+ {{/sectiontitle}}
{{#hidden}} - {{#str}}hiddenfromstudents{{/str}} + + {{#pix}}i/show, core{{/pix}} + {{#str}}hiddenfromstudents{{/str}} + {{/hidden}} {{#stealth}} - {{#str}}hiddenoncoursepage{{/str}} + + {{#pix}}t/stealth, core{{/pix}} + {{#str}}hiddenoncoursepage{{/str}} + {{/stealth}}
diff --git a/course/format/templates/local/overview/overviewtable.mustache b/course/format/templates/local/overview/overviewtable.mustache index 8b5866ad534..a0475eed65f 100644 --- a/course/format/templates/local/overview/overviewtable.mustache +++ b/course/format/templates/local/overview/overviewtable.mustache @@ -72,7 +72,7 @@ ] } }} -
+