]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14617 removed some legacy group code - fixed regression
authorskodak <skodak>
Thu, 1 May 2008 22:32:15 +0000 (22:32 +0000)
committerskodak <skodak>
Thu, 1 May 2008 22:32:15 +0000 (22:32 +0000)
lib/deprecatedlib.php

index 7be45bf4e2fe4b31773768f0f3c33beed09f2c60..d90c4f275c804bd9838249928d5b00dcf596b745 100644 (file)
@@ -797,6 +797,22 @@ function groupmode($course, $cm=null) {
     return $course->groupmode;
 }
 
+/**
+ * Sets the current group in the session variable
+ * When $SESSION->currentgroup[$courseid] is set to 0 it means, show all groups.
+ * Sets currentgroup[$courseid] in the session variable appropriately.
+ * Does not do any permission checking.
+ * @uses $SESSION
+ * @param int $courseid The course being examined - relates to id field in
+ * 'course' table.
+ * @param int $groupid The group being examined.
+ * @return int Current group id which was set by this function
+ */
+function set_current_group($courseid, $groupid) {
+    global $SESSION;
+    return $SESSION->currentgroup[$courseid] = $groupid;
+}
+
 
 /**
  * Gets the current group - either from the session variable or from the database.