diff --git a/course/format/classes/output/local/content/cm/cmname.php b/course/format/classes/output/local/content/cm/cmname.php index 9c7c9ad321001..99825d10818e1 100644 --- a/course/format/classes/output/local/content/cm/cmname.php +++ b/course/format/classes/output/local/content/cm/cmname.php @@ -110,14 +110,12 @@ public function export_for_template(\renderer_base $output): array { 'iconclass' => $iconclass, 'modname' => $mod->modname, 'textclasses' => $displayoptions['textclasses'] ?? '', + 'pluginname' => get_string('pluginname', 'mod_' . $mod->modname), + 'showpluginname' => $this->format->show_editor(), 'purpose' => plugin_supports('mod', $mod->modname, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER), 'activityname' => $this->get_title_data($output), ]; - if ($this->format->show_editor()) { - $data['pluginname'] = get_string('pluginname', 'mod_' . $mod->modname); - } - return $data; } diff --git a/course/format/templates/local/content/cm/cmname.mustache b/course/format/templates/local/content/cm/cmname.mustache index 62389885190b8..c001b82477a0b 100644 --- a/course/format/templates/local/content/cm/cmname.mustache +++ b/course/format/templates/local/content/cm/cmname.mustache @@ -27,6 +27,7 @@ "icon": "../../../pix/help.svg", "iconclass": "", "pluginname": "File", + "showpluginname": 1, "textclasses": "", "purpose": "content", "modname": "resource", @@ -48,14 +49,16 @@
- {{{modname}}} icon + {{#cleanstr}} activityicon, moodle, {{{pluginname}}} {{/cleanstr}}
- {{#pluginname}} + {{#showpluginname}}
{{{pluginname}}}
- {{/pluginname}} + {{/showpluginname}}
{{#activityname}} {{$ core/inplace_editable }} diff --git a/lang/en/moodle.php b/lang/en/moodle.php index fe115e483b81d..e6c8dafc145d3 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -34,6 +34,7 @@ $string['activities_help'] = 'Activities, such as forums, quizzes and wikis, enable interactive content to be added to the course.'; $string['activity'] = 'Activity'; $string['activityclipboard'] = 'Moving this activity: {$a}'; +$string['activityicon'] = '{$a} icon'; $string['activityiscurrentlyhidden'] = 'Sorry, this activity is currently hidden'; $string['activityheader'] = 'Activity menu'; $string['activitymodule'] = 'Activity module';