From ebf5f7bc7831b7ce981f516081df269d0c7e2585 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 28 May 2024 23:45:13 +0800 Subject: [PATCH] MDL-81733 mod_lesson: Coding style fixes --- mod/lesson/locallib.php | 16 +++++++++++----- mod/lesson/mod_form.php | 9 +++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index eedda8b6161..f11fe1ce2d1 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -2329,11 +2329,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'], + ); } } } diff --git a/mod/lesson/mod_form.php b/mod/lesson/mod_form.php index d48047e57dd..d10eb90cfe6 100644 --- a/mod/lesson/mod_form.php +++ b/mod/lesson/mod_form.php @@ -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, + ], + ); } } }