Index: lib/weblib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v retrieving revision 1.970.2.168 diff -u -r1.970.2.168 weblib.php --- lib/weblib.php 21 Apr 2010 12:42:24 -0000 1.970.2.168 +++ lib/weblib.php 23 Apr 2010 11:03:11 -0000 @@ -4695,6 +4695,12 @@ $context = get_context_instance(CONTEXT_COURSE, $courseid); + // If there is no picture, do nothing + if (!$group->picture) { + return ''; + } + + // If picture is hidden, only show to those with course:managegroups if ($group->hidepicture and !has_capability('moodle/course:managegroups', $context)) { return ''; } @@ -4709,12 +4715,13 @@ } else { $file = 'f2'; } - if ($group->picture) { // Print custom group picture - require_once($CFG->libdir.'/filelib.php'); - $grouppictureurl = get_file_url($group->id.'/'.$file.'.jpg', null, 'usergroup'); - $output .= ''.s(get_string('group').' '.$group->name).''; - } + + // Print custom group picture + require_once($CFG->libdir.'/filelib.php'); + $grouppictureurl = get_file_url($group->id.'/'.$file.'.jpg', null, 'usergroup'); + $output .= ''.s(get_string('group').' '.$group->name).''; + if ($link or has_capability('moodle/site:accessallgroups', $context)) { $output .= ''; }