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].
This commit is contained in:
vyshane 2007-01-24 03:03:10 +00:00
parent 560b3acc85
commit 77ea333014
2 changed files with 18 additions and 5 deletions

View File

@ -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);
}

View File

@ -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");
}
/**