Merge branch 'wip-MDL-32037-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Sam Hemelryk
2012-03-20 13:33:30 +13:00
2 changed files with 12 additions and 2 deletions
+11 -1
View File
@@ -150,7 +150,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) {
@@ -690,6 +694,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;
@@ -1200,6 +1207,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;
+1 -1
View File
@@ -66,7 +66,7 @@ if (empty($_POST) && !empty($action)) {
}
if (!confirm_sesskey()) {
$err->error = get_string('invalidsesskey');
$err->error = get_string('invalidsesskey', 'error');
die(json_encode($err));
}