From fbc7f2af93337e8f8d9c5188c8235e1140a8f411 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Wed, 17 Apr 2013 14:07:38 +0800 Subject: [PATCH] MDL-33379 course: Removed deprecated move_section() from course/lib.php --- course/lib.php | 32 -------------------------------- lib/deprecatedlib.php | 7 +++++++ 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/course/lib.php b/course/lib.php index a94e38ebca8..e77b08ae325 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1575,38 +1575,6 @@ function delete_mod_from_section($modid, $sectionid) { return false; } -/** - * Moves a section up or down by 1. CANNOT BE USED DIRECTLY BY AJAX! - * - * @param object $course course object - * @param int $section Section number (not id!!!) - * @param int $move (-1 or 1) - * @return boolean true if section moved successfully - * @todo MDL-33379 remove this function in 2.5 - */ -function move_section($course, $section, $move) { - debugging('This function will be removed before 2.5 is released please use move_section_to', DEBUG_DEVELOPER); - -/// Moves a whole course section up and down within the course - global $USER; - - if (!$move) { - return true; - } - - $sectiondest = $section + $move; - - // compartibility with course formats using field 'numsections' - $courseformatoptions = course_get_format($course)->get_format_options(); - if (array_key_exists('numsections', $courseformatoptions) && - $sectiondest > $courseformatoptions['numsections'] or $sectiondest < 1) { - return false; - } - - $retval = move_section_to($course, $section, $sectiondest); - return $retval; -} - /** * Moves a section within a course, from a position to another. * Be very careful: $section and $destination refer to section number, diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 8022c44df6f..cd081df7200 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -4515,3 +4515,10 @@ function get_courses_wmanagers($categoryid=0, $sort="c.sortorder ASC", $fields=a return $courses; } + +/** + * @deprecated since Moodle 2.3 + */ +function move_section($course, $section, $move) { + throw new coding_exception('move_section() can not be used any more, please see move_section_to().'); +}