mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-46427 Course: Correcting dimmed course link class on profile pages.
This commit is contained in:
parent
ec36fafc0f
commit
846abed55f
@ -375,19 +375,19 @@ if (!isset($hiddenfields['mycourses'])) {
|
||||
if ($mycourse->category) {
|
||||
context_helper::preload_from_record($mycourse);
|
||||
$ccontext = context_course::instance($mycourse->id);
|
||||
$class = '';
|
||||
$linkattributes = null;
|
||||
if ($mycourse->visible == 0) {
|
||||
if (!has_capability('moodle/course:viewhiddencourses', $ccontext)) {
|
||||
continue;
|
||||
}
|
||||
$class = 'class="dimmed"';
|
||||
$linkattributes['class'] = 'dimmed';
|
||||
}
|
||||
$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 .= html_writer::link($url, $ccontext->get_context_name(false), $linkattributes);
|
||||
$courselisting .= ', ';
|
||||
}
|
||||
$shown++;
|
||||
|
@ -319,19 +319,19 @@ if (!isset($hiddenfields['mycourses'])) {
|
||||
$ccontext = context_course::instance($mycourse->id);
|
||||
$cfullname = $ccontext->get_context_name(false);
|
||||
if ($mycourse->id != $course->id) {
|
||||
$class = '';
|
||||
$linkattributes = null;
|
||||
if ($mycourse->visible == 0) {
|
||||
if (!has_capability('moodle/course:viewhiddencourses', $ccontext)) {
|
||||
continue;
|
||||
}
|
||||
$class = 'class="dimmed"';
|
||||
$linkattributes['class'] = 'dimmed';
|
||||
}
|
||||
$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 .= html_writer::link($url, $ccontext->get_context_name(false), $linkattributes);
|
||||
$courselisting .= ', ';
|
||||
} else {
|
||||
$courselisting .= $cfullname . ", ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user