Merge branch 'MDL-43411-master' of git://github.com/andrewnicols/moodle
[moodle.git] / course / lib.php
index d4e49b9..c1e9a14 100644 (file)
@@ -3207,7 +3207,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
     );
 
     // Include course dragdrop
-    if ($course->id != $SITE->id) {
+    if (course_format_uses_sections($course->format)) {
         $PAGE->requires->yui_module('moodle-course-dragdrop', 'M.course.init_section_dragdrop',
             array(array(
                 'courseid' => $course->id,
@@ -3245,8 +3245,8 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
             'emptydragdropregion'
         ), 'moodle');
 
-    // Include format-specific strings
-    if ($course->id != $SITE->id) {
+    // Include section-specific strings for formats which support sections.
+    if (course_format_uses_sections($course->format)) {
         $PAGE->requires->strings_for_js(array(
                 'showfromothers',
                 'hidefromothers',