diff --git a/user/view.php b/user/view.php index 7cb665fa27b..a2d2428411d 100644 --- a/user/view.php +++ b/user/view.php @@ -306,14 +306,20 @@ /// Print the Custom User Fields profile_display_fields($user->id); - if ($mycourses = get_my_courses($user->id, null, null, false, 21)) { $shown=0; $courselisting = ''; foreach ($mycourses as $mycourse) { - if ($mycourse->visible and $mycourse->category) { + if ($mycourse->category) { if ($mycourse->id != $course->id){ - $courselisting .= "wwwroot/user/view.php?id=$user->id&course=$mycourse->id\">" + $class = ''; + if ($mycourse->visible == 0) { + // get_my_courses will filter courses $USER cannot see + // if we get one with visible 0 it just means it's hidden + // ... but not from $USER + $class = 'class="dimmed"'; + } + $courselisting .= "wwwroot}/user/view.php?id={$user->id}&course={$mycourse->id}\" $class >" . format_string($mycourse->fullname) . ", "; } else {