From 84fc08823913530e76c114440cecc72e1176f4cd Mon Sep 17 00:00:00 2001 From: nfreear Date: Thu, 21 Dec 2006 11:51:17 +0000 Subject: [PATCH] Integration 3 - groups in core, modules, calendar... (Part of MDL-7380, new groups) --- group/groupui/printgrouping.php | 51 +++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/group/groupui/printgrouping.php b/group/groupui/printgrouping.php index 9e3dca384e..04e9135031 100644 --- a/group/groupui/printgrouping.php +++ b/group/groupui/printgrouping.php @@ -1,8 +1,16 @@ wwwroot/user/index.php?id=$courseid\">$strparticipants ". "-> wwwroot/group/groupui/index.php?id=$courseid\">$strgroups". "-> Display grouping", "", "", true, '', user_login_string($course, $USER)); - + $groupingsettings = groups_get_grouping_settings($groupingid); - - // Print the name of the grouping - $name = $groupingsettings->name; - print("

$name

"); - + + if (! isset($groupingsettings->name)) { + print_error('errorinvalidgrouping', 'group', groups_home_url($courseid)); + } else { + // Print the name of the grouping + $name = $groupingsettings->name; + echo "

$name

\n"; + } + // Get the groups and group members for the grouping $groupids = groups_get_groups_in_grouping($groupingid); - + if ($groupids != false) { - + // Make sure the groups are in the right order foreach($groupids as $groupid) { $listgroups[$groupid] = groups_get_group_displayname($groupid); } - + natcasesort($listgroups); - + // Go through each group in turn and print the group name and then the members foreach($listgroups as $groupid=>$groupname) { - print "

$groupname

"; + echo "

$groupname

\n"; $userids = groups_get_members($groupid); if ($userids != false) { // Make sure the users are in the right order @@ -49,16 +61,17 @@ if (isteacheredit($courseid)) { $listmembers[$userid] = groups_get_user_displayname($userid, $courseid); } natcasesort($listmembers); - + + echo "
    \n"; foreach($listmembers as $userid=>$name) { - print("$name
    "); + echo "
  1. $name
  2. \n"; } + echo "
\n"; } } } - - print_footer($course); - + + print_footer($course); } ?> \ No newline at end of file -- 2.39.5