Merge branch 'MDL-43411-master' of git://github.com/andrewnicols/moodle
authorDamyon Wiese <damyon@moodle.com>
Tue, 7 Jan 2014 04:53:07 +0000 (12:53 +0800)
committerDamyon Wiese <damyon@moodle.com>
Tue, 7 Jan 2014 04:53:07 +0000 (12:53 +0800)
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',