]> git.mjollnir.org Git - moodle.git/commitdiff
Editing teachers always can see group picture.
authormoodler <moodler>
Sun, 15 Feb 2004 07:37:48 +0000 (07:37 +0000)
committermoodler <moodler>
Sun, 15 Feb 2004 07:37:48 +0000 (07:37 +0000)
Plus some fixes in print_group_picture()

lib/weblib.php

index 33fa411b0d28a404d10a35c95eb9c7efa4da8ebe..0f6645eac1a0406729543c35c9f25e33b45c0297 100644 (file)
@@ -1222,12 +1222,18 @@ function print_user($user, $course) {
 function print_group_picture($group, $courseid, $large=false, $returnstring=false, $link=true) {
     global $CFG;
 
-    if ($group->hidepicture) {
+    static $isteacheredit;
+
+    if (!isset($isteacheredit)) {
+        $isteacheredit = isteacheredit($courseid);
+    }
+
+    if ($group->hidepicture and !$isteacheredit) {
         return '';
     }
 
-    if ($link) {
-        $output = "<a href=\"$CFG->wwwroot/course/groupphp?id=$courseid&amp;group=$group->id\">";
+    if ($link or $isteacheredit) {
+        $output = "<a href=\"$CFG->wwwroot/course/group.php?id=$courseid&amp;group=$group->id\">";
     } else {
         $output = '';
     }
@@ -1241,13 +1247,13 @@ function print_group_picture($group, $courseid, $large=false, $returnstring=fals
     if ($group->picture) {  // Print custom group picture
         if ($CFG->slasharguments) {        // Use this method if possible for better caching
             $output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/user/pixgroup.php/$group->id/$file.jpg\"".
-                       " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
+                       " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" title=\"$group->name\"/>";
         } else {
             $output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/user/pixgroup.php?file=/$group->id/$file.jpg\"".
-                       " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
+                       " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" title=\"$group->name\"/>";
         }
     }
-    if ($link) {
+    if ($link or $isteacheredit) {
         $output .= "</a>";
     }