MDL-46427 Course: Correcting dimmed course link class on profile pages.
This commit is contained in:
+3
-3
@@ -363,19 +363,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++;
|
||||
|
||||
+3
-3
@@ -318,19 +318,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 . ", ";
|
||||
|
||||
Reference in New Issue
Block a user