From: gustav_delius Date: Sun, 16 Jan 2005 17:54:34 +0000 (+0000) Subject: If the focus is on the section that is being moved then move the focus along. Fixes... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=798b70a12f7a720b9d2c43cd951039b963b50e65;p=moodle.git If the focus is on the section that is being moved then move the focus along. Fixes bug 2026 --- diff --git a/course/lib.php b/course/lib.php index 36d4ce5267..6b74205d1c 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1566,6 +1566,7 @@ function delete_mod_from_section($mod, $section) { function move_section($course, $section, $move) { /// Moves a whole course section up and down within the course + global $USER; if (!$move) { return true; @@ -1591,6 +1592,10 @@ function move_section($course, $section, $move) { if (!set_field("course_sections", "section", $section, "id", $sectiondestrecord->id)) { return false; } + // if the focus is on the section that is being moved, then move the focus along + if (isset($USER->display[$course->id]) and ($USER->display[$course->id] == $section)) { + course_set_display($course->id, $sectiondest); + } return true; }