MDL-41125 course: Only require dndupload library when necessary

This commit is contained in:
Frederic Massart 2013-08-12 11:34:51 +08:00
parent d3fb29877e
commit 5297336942

View File

@ -28,7 +28,6 @@ defined('MOODLE_INTERNAL') || die;
require_once($CFG->libdir.'/completionlib.php');
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->dirroot.'/course/dnduploadlib.php');
require_once($CFG->dirroot.'/course/format/lib.php');
define('COURSE_MAX_LOGS_PER_PAGE', 1000); // records
@ -2886,7 +2885,7 @@ function course_ajax_enabled($course) {
* @return bool
*/
function include_course_ajax($course, $usedmodules = array(), $enabledmodules = null, $config = null) {
global $PAGE, $SITE;
global $CFG, $PAGE, $SITE;
// Ensure that ajax should be included
if (!course_ajax_enabled($course)) {
@ -2981,6 +2980,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
}
// Load drag and drop upload AJAX.
require_once($CFG->dirroot.'/course/dnduploadlib.php');
dndupload_add_to_course($course, $enabledmodules);
return true;