Permalink
Browse files

Merge branch 'wip-MDL-32037-MOODLE_21_STABLE' of git://github.com/mar…

…inaglancy/moodle into MOODLE_21_STABLE
  • Loading branch information...
2 parents a11492d + cbd6ad1 commit fa93616a237424215454e698e01d69b13be1e940 Sam Hemelryk committed Mar 20, 2012
Showing with 12 additions and 2 deletions.
  1. +11 −1 repository/filepicker.js
  2. +1 −1 repository/repository_ajax.php
View
@@ -149,7 +149,11 @@ M.core_filepicker.init = function(Y, options) {
// error checking
if (data && data.error) {
scope.print_msg(data.error, 'error');
- scope.list();
+ if (args.onerror) {
+ args.onerror(id,data,p);
+ } else {
+ Y.one(panel_id).set('innerHTML', '');
+ }
return;
} else if (data && data.event) {
switch (data.event) {
@@ -678,6 +682,9 @@ M.core_filepicker.init = function(Y, options) {
client_id: client_id,
repository_id: repository_id,
'params': params,
+ onerror: function(id, obj, args) {
+ scope.view_files();
+ },
callback: function(id, obj, args) {
if (scope.options.editor_target && scope.options.env=='editor') {
scope.options.editor_target.value=obj.url;
@@ -1189,6 +1196,9 @@ M.core_filepicker.init = function(Y, options) {
params: {'savepath':scope.options.savepath},
repository_id: scope.active_repo.id,
form: {id: id, upload:true},
+ onerror: function(id, o, args) {
+ scope.create_upload_form(data);
+ },
callback: function(id, o, args) {
if (scope.options.editor_target&&scope.options.env=='editor') {
scope.options.editor_target.value=o.url;
@@ -66,7 +66,7 @@
}
if (!confirm_sesskey()) {
- $err->error = get_string('invalidsesskey');
+ $err->error = get_string('invalidsesskey', 'error');
die(json_encode($err));
}

0 comments on commit fa93616

Please sign in to comment.