Permalink
Browse files

Merge branch 'wip-MDL-32184-s22' of http://github.com/phalacee/moodle

…into MOODLE_22_STABLE
  • Loading branch information...
danpoltawski committed Sep 24, 2012
2 parents c5a5eed + 74d4c9e commit 370cb335b1358942ccf83d199e430e61c1af533d
Showing with 4 additions and 1 deletion.
  1. +3 −0 course/view.php
  2. +1 −1 lib/navigationlib.php
View
@@ -17,6 +17,7 @@
$move = optional_param('move', 0, PARAM_INT);
$marker = optional_param('marker',-1 , PARAM_INT);
$switchrole = optional_param('switchrole',-1, PARAM_INT);
+ $return = optional_param('return', 0, PARAM_LOCALURL);
if (empty($id) && empty($name) && empty($idnumber)) {
print_error('unspecifycourseid', 'error');
@@ -122,6 +123,8 @@
// Redirect to site root if Editing is toggled on frontpage
if ($course->id == SITEID) {
redirect($CFG->wwwroot .'/?redirect=0');
+ } else if (!empty($return)) {
+ redirect($CFG->wwwroot . $return);
} else {
redirect($PAGE->url);
}
View
@@ -3177,7 +3177,7 @@ protected function load_course_settings($forceopen = false) {
if (has_capability('moodle/course:update', $coursecontext)) {
// Add the turn on/off settings
- $url = new moodle_url('/course/view.php', array('id'=>$course->id, 'sesskey'=>sesskey()));
+ $url = new moodle_url('/course/view.php', array('id'=>$course->id, 'return'=>str_replace($CFG->wwwroot, '', $this->page->url->out(false)), 'sesskey'=>sesskey()));
if ($this->page->user_is_editing()) {
$url->param('edit', 'off');
$editstring = get_string('turneditingoff');

0 comments on commit 370cb33

Please sign in to comment.