]> git.mjollnir.org Git - moodle.git/commitdiff
UI now selects the relevant grouping and/or group when these are passed as GET parame...
authorvyshane <vyshane>
Wed, 24 Jan 2007 03:03:10 +0000 (03:03 +0000)
committervyshane <vyshane>
Wed, 24 Jan 2007 03:03:10 +0000 (03:03 +0000)
Also fixed javascript for hiding view buttons. Was not working in IE [insert swear words here].

group/index.php
group/lib/clientlib.js

index f4b2865e7559fb28b2e152d11902623e7d062092..c2f5cec4162ccd164699b2351110fc5c334ed0c7 100644 (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);
         }
index 968c3fce6e4e9252ab7be9f65b68cd0214800751..e4c84d4263c81b915a98cebd6c5aa2ff4e7c372b 100644 (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");
 }
 
 /**