From: martinlanghoff Date: Wed, 19 Sep 2007 07:21:47 +0000 (+0000) Subject: user/view: show user courses that are hidden, with dimmed class X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=472b647aa5f94a092042052d3fc365b561abe368;p=moodle.git user/view: show user courses that are hidden, with dimmed class If the $USER can see them, there is no reason to hide courses that may be hidden. But show them dimmed to indicate so. --- diff --git a/user/view.php b/user/view.php index 00491b285d..0dc5e48529 100644 --- a/user/view.php +++ b/user/view.php @@ -323,9 +323,16 @@ $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 {