shortname: $strgroups", $course->fullname,
"wwwroot/course/view.php?id=$courseid\">$course->shortname ".
"-> wwwroot/user/index.php?id=$courseid\">$strparticipants ".
"-> wwwroot/group/groupui/index.php?id=$courseid\">$strgroups".
"-> Display grouping", "", "", true, '', user_login_string($course, $USER));
$groupingname = groups_get_grouping_name($groupingid);
if (! $groupingname) {
print_error('errorinvalidgrouping', 'group', groups_home_url($courseid));
} else {
// Print the name of the grouping
echo "
$groupingname
\n";
}
// Get the groups and group members for the grouping.
if (GROUP_NOT_IN_GROUPING == $groupingid) {
$groupids = groups_get_groups_not_in_any_grouping($courseid);
} else {
$groupids = groups_get_groups_in_grouping($groupingid);
}
if ($groupids) {
// Make sure the groups are in the right order
$group_names = groups_groupids_to_group_names($groupids);
// Go through each group in turn and print the group name and then the members
foreach ($group_names as $group) {
echo "{$group->name}
\n";
$userids = groups_get_members($group->id);
if ($userids != false) {
// Make sure the users are in the right order
$user_names = groups_userids_to_user_names($userids, $courseid);
echo "\n";
foreach ($user_names as $user) {
echo "- {$user->name}
\n";
}
echo "
\n";
}
}
}
print_footer($course);
}
?>