Merge branch 'wip-mdl-33379' of git://github.com/rajeshtaneja/moodle
authorSam Hemelryk <sam@moodle.com>
Mon, 10 Jun 2013 22:35:10 +0000 (10:35 +1200)
committerSam Hemelryk <sam@moodle.com>
Mon, 10 Jun 2013 22:35:10 +0000 (10:35 +1200)
Conflicts:
lib/deprecatedlib.php

course/lib.php
lib/deprecatedlib.php

index a5e17f3..9f2bb26 100644 (file)
@@ -1581,38 +1581,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,
index c52eee2..3aab9f4 100644 (file)
@@ -4662,3 +4662,10 @@ function convert_tabrows_to_tree($tabrows, $selected, $inactive, $activated) {
 
     return $subtree;
 }
+
+/**
+ * @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().');
+}