MDL-41428 repository_coursefiles: Missing white space in name

This commit is contained in:
Frederic Massart 2013-08-27 10:07:29 +08:00
parent 838d78a9ff
commit 5d9b539ee2
2 changed files with 9 additions and 3 deletions

View File

@ -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';

View File

@ -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');
}