mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-10115 User profile: Use moodle_url and html_writer::link for course links on user profiles
This commit is contained in:
parent
9594f50af3
commit
8b05f3a355
@ -382,13 +382,18 @@ if (!isset($hiddenfields['mycourses'])) {
|
||||
}
|
||||
$class = 'class="dimmed"';
|
||||
}
|
||||
$courselisting .= "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&course={$mycourse->id}" .
|
||||
($showallcourses ? "&showallcourses=1" : "") . "\" $class >" .
|
||||
$ccontext->get_context_name(false) . "</a>, ";
|
||||
$params = array('id' => $user->id, 'course' => $mycourse->id);
|
||||
if ($showallcourses) {
|
||||
$params['showallcourses'] = 1;
|
||||
}
|
||||
$url = new moodle_url('/user/view.php', $params);
|
||||
$courselisting .= html_writer::link($url, $ccontext->get_context_name(false), array('class' => $class));
|
||||
$courselisting .= ', ';
|
||||
}
|
||||
$shown++;
|
||||
if (!$showallcourses && $shown == 20) {
|
||||
$courselisting .= "<a href=\"{$CFG->wwwroot}/user/profile.php?id={$user->id}&showallcourses=1\">...</a>";
|
||||
$url = new moodle_url('/user/profile.php', array('id' => $user->id, 'showallcourses' => 1));
|
||||
$courselisting .= html_writer::link($url, '...');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -326,8 +326,13 @@ if (!isset($hiddenfields['mycourses'])) {
|
||||
}
|
||||
$class = 'class="dimmed"';
|
||||
}
|
||||
$courselisting .= "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&course={$mycourse->id}" .
|
||||
($showallcourses ? "&showallcourses=1" : "") . "\" $class >" . $cfullname . "</a>, ";
|
||||
$params = array('id' => $user->id, 'course' => $mycourse->id);
|
||||
if ($showallcourses) {
|
||||
$params['showallcourses'] = 1;
|
||||
}
|
||||
$url = new moodle_url('/user/view.php', $params);
|
||||
$courselisting .= html_writer::link($url, $ccontext->get_context_name(false), array('class' => $class));
|
||||
$courselisting .= ', ';
|
||||
} else {
|
||||
$courselisting .= $cfullname . ", ";
|
||||
$PAGE->navbar->add($cfullname);
|
||||
@ -335,8 +340,8 @@ if (!isset($hiddenfields['mycourses'])) {
|
||||
}
|
||||
$shown++;
|
||||
if (!$showallcourses && $shown >= 20) {
|
||||
$courselisting .= "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}" .
|
||||
"&course=$courseid&showallcourses=1\">...</a>";
|
||||
$url = new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $courseid, 'showallcourses' => 1));
|
||||
$courselisting .= html_writer::link($url, '...');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user