MDL-40527 enrol meta: respect $CFG->courselistshortnames

Thanks to James Henestofel for working this out in MDL-37558. That issue
got complex, so I am just submitting this simple part of it for
integration.
This commit is contained in:
Tim Hunt
2013-07-05 15:37:09 +01:00
parent b5906ea400
commit 712bcc3e09
+3 -1
View File
@@ -46,7 +46,9 @@ class enrol_meta_plugin extends enrol_plugin {
return get_string('pluginname', 'enrol_'.$enrol);
} else if (empty($instance->name)) {
$enrol = $this->get_name();
return get_string('pluginname', 'enrol_'.$enrol) . ' (' . format_string($DB->get_field('course', 'fullname', array('id'=>$instance->customint1))) . ')';
$course = $DB->get_record('course', array('id'=>$instance->customint1));
$coursename = format_string(get_course_display_name_for_list($course));
return get_string('pluginname', 'enrol_' . $enrol) . ' (' . $coursename . ')';
} else {
return format_string($instance->name);
}