mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch '46499-28' of git://github.com/samhemelryk/moodle
This commit is contained in:
commit
0b9635cba4
@ -2282,7 +2282,14 @@ class global_navigation extends navigation_node {
|
||||
$userscourses = enrol_get_users_courses($user->id);
|
||||
$userscoursesnode = $usernode->add(get_string('courses'));
|
||||
|
||||
$count = 0;
|
||||
foreach ($userscourses as $usercourse) {
|
||||
if ($count === (int)$CFG->navcourselimit) {
|
||||
$url = new moodle_url('/user/profile.php', array('id' => $user->id, 'showallcourses' => 1));
|
||||
$userscoursesnode->add(get_string('showallcourses'), $url);
|
||||
break;
|
||||
}
|
||||
$count++;
|
||||
$usercoursecontext = context_course::instance($usercourse->id);
|
||||
$usercourseshortname = format_string($usercourse->shortname, true, array('context' => $usercoursecontext));
|
||||
$usercoursenode = $userscoursesnode->add($usercourseshortname, new moodle_url('/user/view.php', array('id'=>$user->id, 'course'=>$usercourse->id)), self::TYPE_CONTAINER);
|
||||
|
@ -398,7 +398,7 @@ if (!isset($hiddenfields['mycourses'])) {
|
||||
$courselisting .= ', ';
|
||||
}
|
||||
$shown++;
|
||||
if (!$showallcourses && $shown == 20) {
|
||||
if (!$showallcourses && $shown == $CFG->navcourselimit) {
|
||||
$url = new moodle_url('/user/profile.php', array('id' => $user->id, 'showallcourses' => 1));
|
||||
$courselisting .= html_writer::link($url, '...', array('title' => get_string('viewmore')));
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user