Merge branch 'MDL-33842_antivirus_message' of git://github.com/davosmith/moodle

This commit is contained in:
Dan Poltawski 2012-06-19 21:52:27 +08:00
commit f189c540b9

View File

@ -717,14 +717,6 @@ M.form_dndupload.init = function(Y, options) {
this.callback(lastresult);
},
/**
* Log any errors generated
*/
add_error: function(text, errorlevel) {
// TODO
console.log(text);
},
/**
* Upload a single file via an AJAX call to the 'upload' repository. Automatically
* calls do_upload as each upload completes.
@ -748,7 +740,8 @@ M.form_dndupload.init = function(Y, options) {
var result = JSON.parse(xhr.responseText);
if (result) {
if (result.error) {
self.add_error(result.error); // TODO add filename?
self.print_msg(result.error, 'error'); // TODO add filename?
self.uploadfinished();
} else {
// Only update the filepicker if there were no errors
if (result.event == 'fileexists') {
@ -760,11 +753,10 @@ M.form_dndupload.init = function(Y, options) {
result.client_id = self.options.clientid;
}
}
self.processedfiles++;
self.do_upload(result); // continue uploading
} else {
self.add_error(M.util.get_string('serverconnection', 'error'));
this.uploadfinished();
self.print_msg(M.util.get_string('serverconnection', 'error'), 'error');
self.uploadfinished();
}
}
};