Binary files old/.DS_Store and new/.DS_Store differ diff -rupN old/course/edit.php new/course/edit.php --- old/course/edit.php 2008-07-07 09:16:38.000000000 -0500 +++ new/course/edit.php 2010-02-24 14:55:32.000000000 -0600 @@ -9,6 +9,7 @@ $id = optional_param('id', 0, PARAM_INT); // course id $categoryid = optional_param('category', 0, PARAM_INT); // course category - can be changed in edit form + $returnurl = optional_param('returnurl', '', PARAM_TEXT); /// basic access control checks @@ -69,6 +70,7 @@ // now override defaults if course already exists if (!empty($course)) { $course->enrolpassword = $course->password; // we need some other name for password field MDL-9929 + $course->returnurl = $returnurl; $editform->set_data($course); } if ($editform->is_cancelled()){ @@ -122,7 +124,12 @@ if (!update_course($data)) { print_error('coursenotupdated'); } - redirect($CFG->wwwroot."/course/view.php?id=$course->id"); + // Allows redirecting to different locations after save if defined + if ( isset($data->returnurl) && strlen($data->returnurl) > 0 ) { + redirect($CFG->wwwroot.$data->returnurl); + } else { + redirect($CFG->wwwroot."/course/view.php?id=$course->id"); + } } } diff -rupN old/course/edit_form.php new/course/edit_form.php --- old/course/edit_form.php 2009-10-02 09:05:36.000000000 -0500 +++ new/course/edit_form.php 2010-02-24 16:24:14.000000000 -0600 @@ -67,6 +67,10 @@ class course_edit_form extends moodlefor $mform->addElement('hidden', 'category', null); $mform->setType('category', PARAM_INT); } + + // Allows redirecting to different locations after save if defined + $mform->addElement('hidden','returnurl'); + $mform->setHelpButton('category', array('coursecategory', get_string('category'))); $mform->setDefault('category', $category->id); $mform->setType('category', PARAM_INT); @@ -304,7 +308,7 @@ class course_edit_form extends moodlefor $options[0] = get_string('none'); $mform->addElement('select', 'defaultgroupingid', get_string('defaultgrouping', 'group'), $options); } - + //-------------------------------------------------------------------------------- $mform->addElement('header','', get_string('availability'));