mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
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.
This commit is contained in:
parent
b00cb46b27
commit
472b647aa5
@ -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&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}&course={$mycourse->id}\" $class >"
|
||||
. format_string($mycourse->fullname) . "</a>, ";
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user