Skip to content
Permalink
Browse files

weblib: MDL-22174 print_group_picture should not print empty links

  • Loading branch information...
sammarshallou committed Apr 23, 2010
1 parent f6eb428 commit 4a9cf90e6a6506ebb33fb70c3283fb55b8c5579a
Showing with 13 additions and 6 deletions.
  1. +13 −6 lib/weblib.php
@@ -2182,6 +2182,12 @@ function print_group_picture($group, $courseid, $large=false, $return=false, $li
$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 '';
}
@@ -2196,12 +2202,13 @@ function print_group_picture($group, $courseid, $large=false, $return=false, $li
} 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 .= '<img class="grouppicture" src="'.$grouppictureurl.'"'.
' alt="'.s(get_string('group').' '.$group->name).'" title="'.s($group->name).'"/>';
}
// Print custom group picture
require_once($CFG->libdir.'/filelib.php');
$grouppictureurl = get_file_url($group->id.'/'.$file.'.jpg', null, 'usergroup');
$output .= '<img class="grouppicture" src="'.$grouppictureurl.'"'.
' alt="'.s(get_string('group').' '.$group->name).'" title="'.s($group->name).'"/>';
if ($link or has_capability('moodle/site:accessallgroups', $context)) {
$output .= '</a>';
}

0 comments on commit 4a9cf90

Please sign in to comment.
You can’t perform that action at this time.