Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-32008 Remove old group deletion code

  • Loading branch information...
commit cab03a03b4a4fec59b37dbb8f94a0747d5c287b7 1 parent 2064994
Andrew Nicols andrewnicols authored

Showing 1 changed file with 4 additions and 24 deletions. Show diff stats Hide diff stats

  1. +4 24 group/group.php
28 group/group.php
@@ -35,10 +35,12 @@
35 35
36 36 // This script used to support group delete, but that has been moved. In case
37 37 // anyone still links to it, let's redirect to the new script.
38   -if($delete) {
39   - redirect('delete.php?courseid='.$courseid.'&groups='.$id);
  38 +if ($delete) {
  39 + debugging('Deleting a group through group/group.php is deprecated and will be removed soon. Please use group/delete.php instead');
  40 + redirect(new moodle_url('delete.php', array('courseid' => $courseid, 'groups' => $id)));
40 41 }
41 42
  43 +
42 44 if ($id) {
43 45 if (!$group = $DB->get_record('groups', array('id'=>$id))) {
44 46 print_error('invalidgroupid');
@@ -74,28 +76,6 @@
74 76
75 77 $returnurl = $CFG->wwwroot.'/group/index.php?id='.$course->id.'&group='.$id;
76 78
77   -if ($id and $delete) {
78   - if (!$confirm) {
79   - $PAGE->set_title(get_string('deleteselectedgroup', 'group'));
80   - $PAGE->set_heading($course->fullname . ': '. get_string('deleteselectedgroup', 'group'));
81   - echo $OUTPUT->header();
82   - $optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
83   - $optionsno = array('id'=>$courseid);
84   - $formcontinue = new single_button(new moodle_url('group.php', $optionsyes), get_string('yes'), 'get');
85   - $formcancel = new single_button(new moodle_url($baseurl, $optionsno), get_string('no'), 'get');
86   - echo $OUTPUT->confirm(get_string('deletegroupconfirm', 'group', $group->name), $formcontinue, $formcancel);
87   - echo $OUTPUT->footer();
88   - die;
89   -
90   - } else if (confirm_sesskey()){
91   - if (groups_delete_group($id)) {
92   - redirect('index.php?id='.$course->id);
93   - } else {
94   - print_error('erroreditgroup', 'group', $returnurl);
95   - }
96   - }
97   -}
98   -
99 79 // Prepare the description editor: We do support files for group descriptions
100 80 $editoroptions = array('maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$course->maxbytes, 'trust'=>false, 'context'=>$context, 'noclean'=>true);
101 81 if (!empty($group->id)) {

0 comments on commit cab03a0

Please sign in to comment.
Something went wrong with that request. Please try again.