]> git.mjollnir.org Git - moodle.git/commitdiff
group MDL-19798 Added set_url calls
authorsamhemelryk <samhemelryk>
Fri, 16 Oct 2009 03:16:38 +0000 (03:16 +0000)
committersamhemelryk <samhemelryk>
Fri, 16 Oct 2009 03:16:38 +0000 (03:16 +0000)
group/assign.php
group/delete.php
group/grouping.php
group/groupings.php

index 422d5bc0897d93703cd0bb71c1b09bd819afa77a..c81fd27c8e87019596df939db89bcde400bfbb2a 100644 (file)
@@ -1,13 +1,35 @@
-<?php  // $Id$
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
 /**
  * Add/remove group from grouping.
+ *
+ * @copyright 1999 Martin Dougiamas  http://dougiamas.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  * @package groups
  */
+
 require_once('../config.php');
 require_once('lib.php');
 
 $groupingid = required_param('id', PARAM_INT);
 
+$PAGE->set_url(new moodle_url($CFG->wwwroot.'/group/assign.php', array('id'=>$groupingid)));
+
 if (!$grouping = $DB->get_record('groupings', array('id'=>$groupingid))) {
     print_error('invalidgroupid');
 }
index 2b089fe817bffbfb20c068a57b7fa5e494e07d18..cf731eb48a0f78aa59dbeb31c4d691c66fed2adb 100644 (file)
@@ -16,6 +16,8 @@ $courseid = required_param('courseid', PARAM_INT);
 $groupids = required_param('groups', PARAM_SEQUENCE);
 $confirm = optional_param('confirm', 0, PARAM_BOOL);
 
+$PAGE->set_url(new moodle_url($CFG->wwwroot.'/group/delete.php', array('courseid'=>$courseid,'groups'=>$groupids)));
+
 // Make sure course is OK and user has access to manage groups
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
     print_error('invalidcourseid');
index efd64d48855f497ac40e5e164d32156a96e0e3ca..f2e295785c7ae66389b9fecd1b2945712fde0ec4 100644 (file)
@@ -18,16 +18,19 @@ $id       = optional_param('id', 0, PARAM_INT);
 $delete   = optional_param('delete', 0, PARAM_BOOL);
 $confirm  = optional_param('confirm', 0, PARAM_BOOL);
 
+$url = new moodle_url($CFG->wwwroot.'/group/grouping.php');
 if ($id) {
+    $url->param('id', $id);
     if (!$grouping = $DB->get_record('groupings', array('id'=>$id))) {
         print_error('invalidgroupid');
     }
     $grouping->description = clean_text($grouping->description);
     if (empty($courseid)) {
         $courseid = $grouping->courseid;
-
     } else if ($courseid != $grouping->courseid) {
         print_error('invalidcourseid');
+    } else {
+        $url->param('courseid', $courseid);
     }
 
     if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
@@ -35,6 +38,7 @@ if ($id) {
     }
 
 } else {
+    $url->param('courseid', $courseid);
     if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
         print_error('invalidcourseid');
     }
@@ -42,6 +46,8 @@ if ($id) {
     $grouping->courseid = $course->id;
 }
 
+$PAGE->set_url($url);
+
 require_login($course);
 $context = get_context_instance(CONTEXT_COURSE, $course->id);
 require_capability('moodle/course:managegroups', $context);
index f0679136810bcd3ab3920cb5bce02f5a00b8156a..64e87f6b6dd87d5b6d48daf5b7ade5e487a22914 100644 (file)
@@ -1,11 +1,35 @@
-<?php // $Id$
-      // Allows a creator to edit groupings
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Allows a creator to edit groupings
+ *
+ * @copyright 1999 Martin Dougiamas  http://dougiamas.com
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package groups
+ */
 
 require_once '../config.php';
 require_once $CFG->dirroot.'/group/lib.php';
 
 $courseid = required_param('id', PARAM_INT);
 
+$PAGE->set_url(new moodle_url($CFG->wwwroot.'/group/groupings.php', array('id'=>$courseid)));
+
 if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
     print_error('nocourseid');
 }