Permalink
Browse files

Merge branch 'MDL-30569-m21' of git://github.com/ankitagarwal/moodle …

…into MOODLE_21_STABLE
  • Loading branch information...
nebgor committed Dec 20, 2011
2 parents 107ebdb + c87fee8 commit 4b61488d0fa14d11df09c17868bf7583f1d96315
Showing with 12 additions and 2 deletions.
  1. +12 −2 course/view.php
View
@@ -107,14 +107,24 @@
if ($PAGE->user_allowed_editing()) {
if (($edit == 1) and confirm_sesskey()) {
$USER->editing = 1;
- redirect($PAGE->url);
+ // Redirect to site root if Editing is toggled on frontpage
+ if ($course->id == SITEID) {
+ redirect($CFG->wwwroot .'/?redirect=0');
+ } else {
+ redirect($PAGE->url);
+ }
} else if (($edit == 0) and confirm_sesskey()) {
$USER->editing = 0;
if(!empty($USER->activitycopy) && $USER->activitycopycourse == $course->id) {
$USER->activitycopy = false;
$USER->activitycopycourse = NULL;
}
- redirect($PAGE->url);
+ // Redirect to site root if Editing is toggled on frontpage
+ if ($course->id == SITEID) {
+ redirect($CFG->wwwroot .'/?redirect=0');
+ } else {
+ redirect($PAGE->url);
+ }
}
if ($hide && confirm_sesskey()) {

0 comments on commit 4b61488

Please sign in to comment.