Skip to content

Commit

Permalink
Merge branch 'MDL-26404_nav_too_wide' of git://github.com/andyjdavis/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
stronk7 committed Feb 28, 2011
2 parents 70e6628 + b2bce32 commit 77e4bb7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion message/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
define('MESSAGE_SEARCH_MAX_RESULTS', 200);

define('MESSAGE_CONTACTS_PER_PAGE',10);
define('MESSAGE_MAX_COURSE_NAME_LENGTH', 30);

if (!isset($CFG->message_contacts_refresh)) { // Refresh the contacts list every 60 seconds
$CFG->message_contacts_refresh = 60;
Expand Down Expand Up @@ -463,7 +464,13 @@ function message_print_usergroup_selector($viewing, $courses, $coursecontexts, $

foreach($courses as $course) {
if (has_capability('moodle/course:viewparticipants', $coursecontexts[$course->id])) {
$courses_options[VIEW_COURSE.$course->id] = $course->shortname;
//Not using short_text() as we want the end of the course name. Not the beginning.
$textlib = textlib_get_instance();
if ($textlib->strlen($course->shortname) > MESSAGE_MAX_COURSE_NAME_LENGTH) {
$courses_options[VIEW_COURSE.$course->id] = '...'.$textlib->substr($course->shortname, -MESSAGE_MAX_COURSE_NAME_LENGTH);
} else {
$courses_options[VIEW_COURSE.$course->id] = $course->shortname;
}
}
}

Expand Down

0 comments on commit 77e4bb7

Please sign in to comment.