From 97ea483380da83998bec350888d87fd00132b186 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 15 Feb 2004 07:37:48 +0000 Subject: [PATCH] Editing teachers always can see group picture. Plus some fixes in print_group_picture() --- lib/weblib.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 33fa411b0d..0f6645eac1 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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 = "wwwroot/course/groupphp?id=$courseid&group=$group->id\">"; + if ($link or $isteacheredit) { + $output = "wwwroot/course/group.php?id=$courseid&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 .= "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 .= "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 .= ""; } -- 2.39.5