From 8d5e99f0863f0899bfd4e22022b3a646cbe930e4 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 27 Mar 2007 04:09:19 +0000 Subject: [PATCH] MDL-9040: Enabled disabling of any buttons that always lead to errors. Javascript dynamically displays/hides buttons depending on which groupings/groups are selected. This required a number of extensive modifications, but degrades nicely without JS. --- group/lib/utillib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/group/lib/utillib.php b/group/lib/utillib.php index 073adaf01c6df..dde711a1eb20d 100644 --- a/group/lib/utillib.php +++ b/group/lib/utillib.php @@ -39,6 +39,11 @@ function groups_count_group_members($groupid) { function groups_count_groups_in_grouping($groupingid, $courseid) { if (GROUP_NOT_IN_GROUPING == $groupingid) { $groupids = groups_get_groups_not_in_any_grouping($courseid); + + if ($groupids === false) { + return false; + } + return count($groupids); } elseif (GROUP_ANY_GROUPING == $groupingid) { return count_records('groups_courses_groups', 'courseid', $courseid); @@ -414,4 +419,4 @@ function groups_param_action($prefix = 'act_') { return $action; } -?> \ No newline at end of file +?>