From: skodak Date: Thu, 1 May 2008 22:32:15 +0000 (+0000) Subject: MDL-14617 removed some legacy group code - fixed regression X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c584346cd51606059d7ee30d6889efff2bc35bf1;p=moodle.git MDL-14617 removed some legacy group code - fixed regression --- diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 7be45bf4e2..d90c4f275c 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -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.