Skip to content

Commit

Permalink
user/view: show user courses that are hidden, with dimmed class
Browse files Browse the repository at this point in the history
If the $USER can see them, there is no reason to hide courses that
may be hidden. But show them dimmed to indicate so.
  • Loading branch information
martinlanghoff committed Sep 19, 2007
1 parent b00cb46 commit 472b647
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions user/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;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 .= "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&amp;course={$mycourse->id}\" $class >"
. format_string($mycourse->fullname) . "</a>, ";
}
else {
Expand Down

0 comments on commit 472b647

Please sign in to comment.