]> git.mjollnir.org Git - moodle.git/commitdiff
Altered buttons from index and view pages
authormartin <martin>
Sat, 27 Jul 2002 10:23:45 +0000 (10:23 +0000)
committermartin <martin>
Sat, 27 Jul 2002 10:23:45 +0000 (10:23 +0000)
user/index.php
user/view.php

index e4a6779eabee25db2814cf29ca6ac3e1907e8059..fa6a8e68cff2a37ecdfa788195efd4b753ef6f4c 100644 (file)
@@ -54,7 +54,7 @@
 
 function print_user($user, $course, $teacherlinks) {
 
-    global $COUNTRIES;
+    global $USER, $COUNTRIES;
     
     echo "<TABLE WIDTH=80% ALIGN=CENTER BORDER=0 CELLPADDING=1 CELLSPACING=1><TR><TD BGCOLOR=#888888>";
     echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>";
@@ -80,13 +80,11 @@ function print_user($user, $course, $teacherlinks) {
     if ($teacherlinks) {
         $timemidnight = usergetmidnight(time());
         echo "<A HREF=\"../course/user.php?id=$course->id&user=$user->id\">".get_string("activity")."</A><BR>";
-        echo "<A HREF=\"../course/log.php?id=$course->id&user=$user->id&date=$timemidnight\">".get_string("todaylogs")."</A><BR>";
-        echo "<A HREF=\"../course/log.php?id=$course->id&user=$user->id\">".get_string("alllogs")."</A><BR>";
         echo "<A HREF=\"../course/unenrol.php?id=$course->id&user=$user->id\">".get_string("unenrol")."</A><BR>";
         if (isstudent($course->id, $user->id)) {
             echo "<A HREF=\"../course/loginas.php?id=$course->id&user=$user->id\">".get_string("loginas")."</A><BR>";
         }
-    }
+    } 
     echo "<A HREF=\"view.php?id=$user->id&course=$course->id\">".get_string("fullprofile")."...</A>";
     echo "</FONT>";
 
index dd2fe22f453aa6383aeeb5a1554463fe4e5f9374..21704ed0d8cda238bed48d269e89876fe4276ac6 100644 (file)
     echo "</TD></TR></TABLE></TABLE>";
 
 //  Print other functions
-    if ($user->id == $USER->id and !isguest() ) {
-        echo "<CENTER><TABLE ALIGN=CENTER><TR>";
+    echo "<CENTER><TABLE ALIGN=CENTER><TR>";
+    if (isteacher($course->id) or ($user->id == $USER->id and !isguest()) ) {
         echo "<TD NOWRAP><P><FORM ACTION=\"../course/unenrol.php\" METHOD=GET>";
         echo "<INPUT type=hidden name=id value=\"$course->id\">";
+        echo "<INPUT type=hidden name=user value=\"$user->id\">";
         echo "<INPUT type=submit value=\"".get_string("unenrolme", "", $course->shortname)."\">";
         echo "</FORM></P></TD>";
-        echo "</TR></TABLE></CENTER>\n";
     }
+    if (isteacher($course->id)) {
+        echo "<TD NOWRAP><P><FORM ACTION=\"../course/user.php\" METHOD=GET>";
+        echo "<INPUT type=hidden name=id value=\"$course->id\">";
+        echo "<INPUT type=hidden name=user value=\"$user->id\">";
+        echo "<INPUT type=submit value=\"".get_string("activityreport")."\">";
+        echo "</FORM></P></TD>";
+        echo "<TD NOWRAP><P><FORM ACTION=\"../course/loginas.php\" METHOD=GET>";
+        echo "<INPUT type=hidden name=id value=\"$course->id\">";
+        echo "<INPUT type=hidden name=user value=\"$user->id\">";
+        echo "<INPUT type=submit value=\"".get_string("loginas")."\">";
+        echo "</FORM></P></TD>";
+    }
+    echo "</TR></TABLE></CENTER>\n";
 
     print_user_discussions($course, $user);