Permalink
Browse files

Merge branch 'MDL-34704_22' of git://github.com/timhunt/moodle into M…

…OODLE_22_STABLE
  • Loading branch information...
2 parents eab358f + 45c29ec commit 8a991d869292ff199b9ff6f3a0741c2692ca24bf @stronk7 stronk7 committed Aug 7, 2012
Showing with 20 additions and 19 deletions.
  1. +0 −16 course/lib.php
  2. +2 −2 lang/en/admin.php
  3. +1 −0 lang/en/moodle.php
  4. +1 −1 lib/accesslib.php
  5. +16 −0 lib/moodlelib.php
View
@@ -2186,22 +2186,6 @@ function make_categories_options() {
}
/**
- * Gets the name of a course to be displayed when showing a list of courses.
- * By default this is just $course->fullname but user can configure it. The
- * result of this function should be passed through print_string.
- * @param object $course Moodle course object
- * @return string Display name of course (either fullname or short + fullname)
- */
-function get_course_display_name_for_list($course) {
- global $CFG;
- if (!empty($CFG->courselistshortnames)) {
- return $course->shortname . ' ' .$course->fullname;
- } else {
- return $course->fullname;
- }
-}
-
-/**
* Prints the category info in indented fashion
* This function is only used by print_whole_category_list() above
*/
View
@@ -351,8 +351,8 @@
$string['country'] = 'Default country';
$string['coursecontact'] = 'Course contacts';
$string['coursecontact_desc'] = 'This setting allows you to control who appears on the course description. Users need to have at least one of these roles in a course to be shown on the course description for that course.';
-$string['courselistshortnames'] = 'Display short names';
-$string['courselistshortnames_desc'] = 'Show short name as well as full name when displaying lists of courses.';
+$string['courselistshortnames'] = 'Display extended course names';
+$string['courselistshortnames_desc'] = 'When showing lists of courses, or when referring to courses on administration screens, show the course short name as well as the full name. In fact, when you turn this setting on, the display uses the \'courseextendednamedisplay\' language string, so you can changewhat is displayed using Language customisation.';
$string['coursemgmt'] = 'Add/edit courses';
$string['courseoverview'] = 'Course overview';
$string['courserequestnotify'] = 'Course request notification';
View
@@ -292,6 +292,7 @@
$string['coursecreators'] = 'Course creator';
$string['coursecreatorsdescription'] = 'Course creators can create new courses.';
$string['coursedeleted'] = 'Deleted course {$a}';
+$string['courseextendednamedisplay'] = '{$a->shortname} {$a->fullname}';
$string['coursefiles'] = 'Legacy course files';
$string['coursefilesedit'] = 'Edit legacy course files';
$string['coursefileswarning'] = 'Course files are deprecated';
View
@@ -6205,7 +6205,7 @@ public function get_context_name($withprefix = true, $short = false) {
if ($short){
$name .= format_string($course->shortname, true, array('context' => $this));
} else {
- $name .= format_string($course->fullname);
+ $name .= format_string(get_course_display_name_for_list($course));
}
}
}
View
@@ -10605,3 +10605,19 @@ function get_home_page() {
}
return HOMEPAGE_SITE;
}
+
+/**
+ * Gets the name of a course to be displayed when showing a list of courses.
+ * By default this is just $course->fullname but user can configure it. The
+ * result of this function should be passed through print_string.
+ * @param object $course Moodle course object
+ * @return string Display name of course (either fullname or short + fullname)
+ */
+function get_course_display_name_for_list($course) {
+ global $CFG;
+ if (!empty($CFG->courselistshortnames)) {
+ return get_string('courseextendednamedisplay', '', $course);
+ } else {
+ return $course->fullname;
+ }
+}

0 comments on commit 8a991d8

Please sign in to comment.