diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php index a90491516fa59..9522884e745c6 100644 --- a/lib/outputrequirementslib.php +++ b/lib/outputrequirementslib.php @@ -395,7 +395,7 @@ protected function find_module($component) { case 'core_filepicker': $module = array('name' => 'core_filepicker', 'fullpath' => '/repository/filepicker.js', - 'requires' => array('base', 'node', 'node-event-simulate', 'json', 'async-queue', 'io', 'yui2-button', 'yui2-container', 'yui2-layout', 'yui2-menu', 'yui2-treeview', 'yui2-dragdrop', 'yui2-cookie'), + 'requires' => array('base', 'node', 'node-event-simulate', 'json', 'async-queue', 'io-base', 'io-upload-iframe', 'yui2-button', 'yui2-container', 'yui2-layout', 'yui2-menu', 'yui2-treeview', 'yui2-dragdrop', 'yui2-cookie'), 'strings' => array(array('add', 'repository'), array('back', 'repository'), array('cancel', 'moodle'), array('close', 'repository'), array('cleancache', 'repository'), array('copying', 'repository'), array('date', 'repository'), array('downloadsucc', 'repository'), array('emptylist', 'repository'), array('error', 'repository'), array('federatedsearch', 'repository'), diff --git a/repository/filepicker.js b/repository/filepicker.js index 5d2fa6daf69f1..a5cfc3d5477bd 100644 --- a/repository/filepicker.js +++ b/repository/filepicker.js @@ -1171,31 +1171,29 @@ M.core_filepicker.init = function(Y, options) { scope.print_msg(M.str.repository.nofilesattached, 'error'); return false; } - Y.use('io-upload-iframe', function() { - scope.request({ - scope: scope, - action:'upload', - client_id: client_id, - params: {'savepath':scope.options.savepath}, - repository_id: scope.active_repo.id, - form: {id: id, upload:true}, - callback: function(id, o, args) { - if (scope.options.editor_target&&scope.options.env=='editor') { - scope.options.editor_target.value=o.url; - scope.options.editor_target.onchange(); - } - scope.hide(); - o.client_id = client_id; - var formcallback_scope = null; - if (args.scope.options.magicscope) { - formcallback_scope = args.scope.options.magicscope; - } else { - formcallback_scope = args.scope; - } - scope.options.formcallback.apply(formcallback_scope, [o]); + scope.request({ + scope: scope, + action:'upload', + client_id: client_id, + params: {'savepath':scope.options.savepath}, + repository_id: scope.active_repo.id, + form: {id: id, upload:true}, + callback: function(id, o, args) { + if (scope.options.editor_target&&scope.options.env=='editor') { + scope.options.editor_target.value=o.url; + scope.options.editor_target.onchange(); } - }, true); - }); + scope.hide(); + o.client_id = client_id; + var formcallback_scope = null; + if (args.scope.options.magicscope) { + formcallback_scope = args.scope.options.magicscope; + } else { + formcallback_scope = args.scope; + } + scope.options.formcallback.apply(formcallback_scope, [o]); + } + }, true); }, this); }, print_header: function() {