From 78b4da19636b6527c081ba1f7beba9d78a442b73 Mon Sep 17 00:00:00 2001 From: Davo Smith Date: Tue, 19 Jun 2012 14:27:12 +0100 Subject: [PATCH] MDL-33842 Filemanager dndupload - now displays error messages (including antivirus) --- lib/form/dndupload.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/form/dndupload.js b/lib/form/dndupload.js index 103d31672dd..53018b9f08e 100644 --- a/lib/form/dndupload.js +++ b/lib/form/dndupload.js @@ -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(); } } };