MDL-81733 mod_lesson: Coding style fixes
This commit is contained in:
+11
-5
@@ -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'],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user