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:30:17 +01:00
parent f8e6e5bc30
commit 70f4ac5aea

View File

@ -45,7 +45,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);
}