Skip to content

Commit

Permalink
Merge branch 'MDL-30569-m21' of git://github.com/ankitagarwal/moodle …
Browse files Browse the repository at this point in the history
…into MOODLE_21_STABLE
  • Loading branch information
Aparup Banerjee committed Dec 20, 2011
2 parents 107ebdb + c87fee8 commit 4b61488
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 4b61488

Please sign in to comment.