mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-30569 Administration Fixing the redirect after editting is toggeled on the front page
This commit is contained in:
parent
acb3bf8ac1
commit
8c14856d86
1 changed files with 12 additions and 2 deletions
|
@ -107,15 +107,25 @@
|
||||||
if ($PAGE->user_allowed_editing()) {
|
if ($PAGE->user_allowed_editing()) {
|
||||||
if (($edit == 1) and confirm_sesskey()) {
|
if (($edit == 1) and confirm_sesskey()) {
|
||||||
$USER->editing = 1;
|
$USER->editing = 1;
|
||||||
|
// Redirect to site root if Editing is toggled on frontpage
|
||||||
|
if ($course->id == SITEID) {
|
||||||
|
redirect($CFG->wwwroot .'/?redirect=0');
|
||||||
|
} else {
|
||||||
redirect($PAGE->url);
|
redirect($PAGE->url);
|
||||||
|
}
|
||||||
} else if (($edit == 0) and confirm_sesskey()) {
|
} else if (($edit == 0) and confirm_sesskey()) {
|
||||||
$USER->editing = 0;
|
$USER->editing = 0;
|
||||||
if(!empty($USER->activitycopy) && $USER->activitycopycourse == $course->id) {
|
if(!empty($USER->activitycopy) && $USER->activitycopycourse == $course->id) {
|
||||||
$USER->activitycopy = false;
|
$USER->activitycopy = false;
|
||||||
$USER->activitycopycourse = NULL;
|
$USER->activitycopycourse = NULL;
|
||||||
}
|
}
|
||||||
|
// Redirect to site root if Editing is toggled on frontpage
|
||||||
|
if ($course->id == SITEID) {
|
||||||
|
redirect($CFG->wwwroot .'/?redirect=0');
|
||||||
|
} else {
|
||||||
redirect($PAGE->url);
|
redirect($PAGE->url);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($hide && confirm_sesskey()) {
|
if ($hide && confirm_sesskey()) {
|
||||||
set_section_visible($course->id, $hide, '0');
|
set_section_visible($course->id, $hide, '0');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue