MDL-81733 mod_lesson: Coding style fixes

This commit is contained in:
Andrew Nicols
2024-05-28 23:45:50 +08:00
parent aae18f59aa
commit 2016d4c6dd
2 changed files with 18 additions and 7 deletions
+11 -5
View File
@@ -2298,11 +2298,17 @@ class lesson extends lesson_base {
if ($modname) {
$instancename = $DB->get_field($modname, 'name', array('id' => $module->instance));
if ($instancename) {
return html_writer::link(new moodle_url('/mod/'.$modname.'/view.php',
['id' => $this->properties->activitylink]),
get_string('activitylinkname', 'lesson',
format_string($instancename, true, ['context' => $this->get_context()])),
['class' => 'centerpadded lessonbutton standardbutton pr-3']);
return html_writer::link(
new moodle_url('/mod/'.$modname.'/view.php', [
'id' => $this->properties->activitylink,
]),
get_string(
'activitylinkname',
'lesson',
format_string($instancename, true, ['context' => $this->get_context()]),
),
['class' => 'centerpadded lessonbutton standardbutton pr-3'],
);
}
}
}
+7 -2
View File
@@ -163,8 +163,13 @@ class mod_lesson_mod_form extends moodleform_mod {
if ($module = get_coursemodule_from_instance($mod->modname, $mod->instance, $COURSE->id)) {
// Exclude this lesson, if it's already been saved.
if (!isset($this->_cm->id) || $this->_cm->id != $mod->id) {
$modinstances[$mod->id] = get_string('pluginname', $mod->modname).' - '.
format_string($module->name, true, ['context' => $this->context]);
$modinstances[$mod->id] = get_string('pluginname', $mod->modname) . ' - ' . format_string(
$module->name,
true,
[
'context' => $this->context,
],
);
}
}
}