$group->courseid = $course->id;
}
+if ($id !== 0) {
+ $PAGE->set_url(new moodle_url($CFG->wwwroot.'/group/group.php', array('id'=>$id)));
+} else {
+ $PAGE->set_url(new moodle_url($CFG->wwwroot.'/group/group.php', array('courseid'=>$courseid)));
+}
+
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('moodle/course:managegroups', $context);
print_error('invalidcourse'); //'The course ID is invalid'
}
+$url = new moodle_url($CFG->wwwroot.'/group/index.php', array('id'=>$courseid));
+if ($userid) {
+ $url->param('user', $userid);
+}
+if ($groupid) {
+ $url->param('group', $groupid);
+}
+$PAGE->set_url($url);
+
// Make sure that the user has permissions to manage groups.
require_login($course);
print_error('invalidcourse');
}
+$url = new moodle_url($CFG->wwwroot.'/group/overview.php', array('course'=>$courseid));
+if ($groupid !== 0) {
+ $url->param('group', $groupid);
+}
+if ($groupingid !== 0) {
+ $url->param('grouping', $groupingid);
+}
+$PAGE->set_url($url);
+
// Make sure that the user has permissions to manage groups.
require_login($course);