Permalink
Browse files

If the focus is on the section that is being moved then move the focu…

…s along. Fixes bug 2026
  • Loading branch information...
gustav_delius
gustav_delius committed Jan 16, 2005
1 parent 181b888 commit 798b70a12f7a720b9d2c43cd951039b963b50e65
Showing with 5 additions and 0 deletions.
  1. +5 −0 course/lib.php
View
@@ -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;
}

0 comments on commit 798b70a

Please sign in to comment.