diff --git a/lang/en/moodle.php b/lang/en/moodle.php index fdbabdbea90..4ed2f993736 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -333,6 +333,7 @@ $string['courselegacyfiles_help'] = 'The course files area provides some backwar If you use this area to store course files, you can expose yourself to a number of privacy and security issues, as well as experiencing missing files in backups, course imports and any time content is shared or re-used. It is therefore recommended that you do not use this area unless you really know what you are doing.'; $string['courselegacyfiles_link'] = 'coursefiles2'; +$string['courselegacyfilesofcourse'] = 'Legacy course files: {$a}'; $string['courseoverview'] = 'Course overview'; $string['courseoverviewgraph'] = 'Course overview graph'; $string['courseprofiles'] = 'Course profiles'; diff --git a/repository/coursefiles/lib.php b/repository/coursefiles/lib.php index 0f795ba6d53..30a111de3f6 100644 --- a/repository/coursefiles/lib.php +++ b/repository/coursefiles/lib.php @@ -180,10 +180,15 @@ class repository_coursefiles extends repository { return parent::is_visible(); } + /** + * Return the repository name. + * + * @return string + */ public function get_name() { - list($context, $course, $cm) = get_context_info_array($this->context->id); - if (!empty($course)) { - return get_string('courselegacyfiles') . format_string($course->shortname, true, array('context' => $context->get_course_context(true))); + $context = $this->context->get_course_context(false); + if ($context) { + return get_string('courselegacyfilesofcourse', 'moodle', $context->get_context_name(false, true)); } else { return get_string('courselegacyfiles'); }