From 77ea333014b062410695f321bf9ef79ccfedd86c Mon Sep 17 00:00:00 2001 From: vyshane Date: Wed, 24 Jan 2007 03:03:10 +0000 Subject: [PATCH] UI now selects the relevant grouping and/or group when these are passed as GET parameters to the script. Also fixed javascript for hiding view buttons. Was not working in IE [insert swear words here]. --- group/index.php | 17 ++++++++++++++++- group/lib/clientlib.js | 6 ++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/group/index.php b/group/index.php index f4b2865e75..c2f5cec416 100644 --- a/group/index.php +++ b/group/index.php @@ -24,6 +24,21 @@ $userid = optional_param('user', false, PARAM_INT); $action = groups_param_action(); +if ($groupid) { + $groupingsforgroup = groups_get_groupings_for_group($groupid); + if ($groupingsforgroup) { + // NOTE + // We currently assume that a group can only belong to one grouping. + // FIXME + // The UI will have to be fixed if we want to support more than one + // groupings per group in the future. + // + // vy-shane AT moodle DOT com + $groupingid = array_shift($groupingsforgroup); + } +} + + // Get the course information so we can print the header and // check the course id is valid $course = groups_get_course_info($courseid); @@ -194,7 +209,7 @@ if ($success) { $groupids = groups_get_groups_in_grouping($sel_groupingid); } if ($groupids) { - // Put the groupings into a hash and sort them + // Put the groups into a hash and sort them foreach($groupids as $id) { $listgroups[$id] = groups_get_group_displayname($id); } diff --git a/group/lib/clientlib.js b/group/lib/clientlib.js index 968c3fce6e..e4c84d4263 100644 --- a/group/lib/clientlib.js +++ b/group/lib/clientlib.js @@ -62,8 +62,7 @@ function UpdatableGroupsCombo(wwwRoot, courseId) { */ // Hide the updategroups input since AJAX will take care of this. - var updateGroupsButton = document.getElementById("updategroups"); - updateGroupsButton.setAttribute("style", "display:none;"); + YAHOO.util.Dom.setStyle("updategroups", "display", "none"); } /** @@ -123,8 +122,7 @@ function UpdatableMembersCombo(wwwRoot, courseId) { }; // Hide the updatemembers input since AJAX will take care of this. - var updateMembersButton = document.getElementById("updatemembers"); - updateMembersButton.setAttribute("style", "display:none;"); + YAHOO.util.Dom.setStyle("updatemembers", "display", "none"); } /** -- 2.39.5