MDL-32508 course: Introduce course_get_url()

This commit is contained in:
Dan Poltawski 2012-04-26 21:36:02 +08:00
parent 45774bddf7
commit 5218b9bb7d
4 changed files with 36 additions and 15 deletions

View file

@ -47,7 +47,7 @@ $mform->set_data($section); // set current value
/// If data submitted, then process and store.
if ($mform->is_cancelled()){
redirect($CFG->wwwroot.'/course/view.php?id='.$course->id);
redirect(course_get_url($course, $section->section));
} else if ($data = $mform->get_data()) {
if (empty($data->usedefaultname)) {
@ -61,7 +61,7 @@ if ($mform->is_cancelled()){
$DB->update_record('course_sections', $section);
add_to_log($course->id, "course", "editsection", "editsection.php?id=$section->id", "$section->section");
$PAGE->navigation->clear_cache();
redirect("view.php?id=$course->id");
redirect(course_get_url($course, $section->section));
}
$sectionname = get_section_name($course, $section);