Permalink
Browse files

fix old protocol suport

  • Loading branch information...
dio-el-claire committed Jul 9, 2011
1 parent 9d43cb0 commit a0c0f5cfc433e08a00d6e6f7767b16fe92eee1d0
Showing with 26 additions and 28 deletions.
  1. +2 −2 elfinder.src.html
  2. +24 −25 js/proxy/elFinderSupportVer1.js
  3. +0 −1 php/elFinder.class.php
View
@@ -121,8 +121,8 @@
$('#finder').elfinder({
- url : 'php/connector.php',
- // transport : new elFinderSupportVer1(),
+ url : 'php-old/connector.php',
+ transport : new elFinderSupportVer1(),
getFileCallback : function(files, fm) {
console.log(files);
},
@@ -16,17 +16,16 @@ window.elFinderSupportVer1 = function() {
this.init = function(fm) {
this.fm = fm;
this.fm.parseUploadData = function(text) {
- var errors = self.fm.errors(),
- data;
+ var data;
if (!$.trim(text)) {
- return {error : [errors.response, errors.empty]};
+ return {error : ['errResponse', 'errDataEmpty']};
}
try {
data = $.parseJSON(text);
} catch (e) {
- return {error : [errors.response, errors.json]}
+ return {error : ['errResponse', 'errDataNotJSON']}
}
return self.normalize('upload', data);
@@ -133,20 +132,20 @@ window.elFinderSupportVer1 = function() {
}
// fix old connectors errors messages as possible
- this.errors = {
- 'Unknown command' : 'Unknown command.',
- 'Invalid backend configuration' : 'Invalid backend configuration.',
- 'Access denied' : 'Access denied.',
- 'PHP JSON module not installed' : 'PHP JSON module not installed.',
- 'File not found' : 'File not found.',
- 'Invalid name' : 'Invalid file name.',
- 'File or folder with the same name already exists' : 'File named "$1" already exists in this location.',
- 'Not allowed file type' : 'Not allowed file type.',
- 'File exceeds the maximum allowed filesize' : 'File exceeds maximum allowed size.',
- 'Unable to copy into itself' : 'Unable to copy "$1" into itself.',
- 'Unable to create archive' : 'Unable to create archive.',
- 'Unable to extract files from archive' : 'Unable to extract files from "$1".'
- }
+ // this.errors = {
+ // 'Unknown command' : 'Unknown command.',
+ // 'Invalid backend configuration' : 'Invalid backend configuration.',
+ // 'Access denied' : 'Access denied.',
+ // 'PHP JSON module not installed' : 'PHP JSON module not installed.',
+ // 'File not found' : 'File not found.',
+ // 'Invalid name' : 'Invalid file name.',
+ // 'File or folder with the same name already exists' : 'File named "$1" already exists in this location.',
+ // 'Not allowed file type' : 'Not allowed file type.',
+ // 'File exceeds the maximum allowed filesize' : 'File exceeds maximum allowed size.',
+ // 'Unable to copy into itself' : 'Unable to copy "$1" into itself.',
+ // 'Unable to create archive' : 'Unable to create archive.',
+ // 'Unable to extract files from archive' : 'Unable to extract files from "$1".'
+ // }
this.normalize = function(cmd, data) {
var self = this,
@@ -158,13 +157,13 @@ window.elFinderSupportVer1 = function() {
return data;
}
- if (data.error) {
- $.each(data.error, function(i, msg) {
- if (self.errors[msg]) {
- data.error[i] = self.errors[msg];
- }
- });
- }
+ // if (data.error) {
+ // $.each(data.error, function(i, msg) {
+ // if (self.errors[msg]) {
+ // data.error[i] = self.errors[msg];
+ // }
+ // });
+ // }
if (cmd == 'upload' && data.error) {
data.warning = $.extend({}, data.error);
View
@@ -36,7 +36,6 @@ class elFinder {
'tree' => array('target' => true),
'parents' => array('target' => true),
'tmb' => array('targets' => true),
- 'sync' => array('target' => true, 'tree' => false, 'mimes' => false),
'file' => array('target' => true, 'download' => false),
'size' => array('targets' => true),
'mkdir' => array('target' => true, 'name' => true),

0 comments on commit a0c0f5c

Please sign in to comment.