]> git.mjollnir.org Git - moodle.git/commitdiff
If the focus is on the section that is being moved then move the focus along. Fixes...
authorgustav_delius <gustav_delius>
Sun, 16 Jan 2005 17:54:34 +0000 (17:54 +0000)
committergustav_delius <gustav_delius>
Sun, 16 Jan 2005 17:54:34 +0000 (17:54 +0000)
course/lib.php

index 36d4ce52675601256dc1096f4a550ddfaa226fac..6b74205d1c024b6be481d2c922cba0b1ca2ae547 100644 (file)
@@ -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;
 }