]> git.mjollnir.org Git - moodle.git/commitdiff
Show enrolled courses on user page to teachers
authormoodler <moodler>
Wed, 19 Nov 2003 07:55:00 +0000 (07:55 +0000)
committermoodler <moodler>
Wed, 19 Nov 2003 07:55:00 +0000 (07:55 +0000)
See http://moodle.org/mod/forum/discuss.php?d=3562

user/view.php

index 732a2defe8d74db2d8b9ad5077144cfc32ad3dae..dfb99f369a7a5d9ea3ea17a9df17d229bc505961 100644 (file)
         print_row("icq:","<a href=\"http://web.icq.com/wwp?uin=$user->icq\">$user->icq <img src=\"http://web.icq.com/whitepages/online?icq=$user->icq&img=5\" width=18 height=18 border=0></a>");
     }
 
+    if (isteacher($course->id)) {
+        if ($mycourses = get_my_courses($user->id)) {
+            $courselisting = '';
+            foreach ($mycourses as $mycourse) {
+                if ($mycourse->visible) {
+                    $courselisting .= "<a href=\"$CFG->wwwroot/course/view.php?id=$mycourse->id\">$mycourse->fullname</a>, ";
+                }
+            }
+            print_row(get_string('courses').':', rtrim($courselisting,', '));
+        }
+    }
+
     if ($user->lastaccess) {
         $datestring = userdate($user->lastaccess)."&nbsp (".format_time(time() - $user->lastaccess).")";
     } else {