diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-02-20 16:33:45 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-02-20 16:33:45 +0100 |
commit | 273e1a146b27e197a7450589594edcb9131e3b5e (patch) | |
tree | ee8a130d1e42e3fbd16a7ef8673c5334ce096e2e | |
parent | 3a364639b7649c12dcdd15e1c0344a35432aedc2 (diff) | |
download | nextcloud-server-273e1a146b27e197a7450589594edcb9131e3b5e.tar.gz nextcloud-server-273e1a146b27e197a7450589594edcb9131e3b5e.zip |
switch to json encoded file list
-rw-r--r-- | apps/files_trashbin/ajax/delete.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/ajax/undelete.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/js/trash.js | 10 |
3 files changed, 8 insertions, 6 deletions
diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index 80382147eb7..34f35c39ccb 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -5,7 +5,7 @@ OCP\JSON::callCheck(); $files = $_POST['files']; $dirlisting = $_POST['dirlisting']; -$list = explode('|', $files); +$list = json_decode($files); $error = array(); $success = array(); diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index b76adb2a2a7..93f2aaf1fa2 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -5,7 +5,7 @@ OCP\JSON::callCheck(); $files = $_POST['files']; $dirlisting = $_POST['dirlisting']; -$list = explode('|', $files); +$list = json_decode($files); $error = array(); $success = array(); diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index c8b862837a6..3841a098147 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -6,9 +6,10 @@ $(document).ready(function() { var tr=$('tr').filterAttr('data-file', filename); var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var undeleteAction = $('tr').filterAttr('data-file',filename).children("td.date"); + var files = tr.attr('data-file'); undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner; $.post(OC.filePath('files_trashbin','ajax','undelete.php'), - {files:tr.attr('data-file'), dirlisting:tr.attr('data-dirlisting') }, + {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') }, function(result){ for (var i = 0; i < result.data.success.length; i++) { var row = document.getElementById(result.data.success[i].filename); @@ -31,10 +32,11 @@ $(document).ready(function() { var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete"); var oldHTML = deleteAction[0].outerHTML; var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'delete file permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; + var files = tr.attr('data-file'); deleteAction[0].outerHTML = newHTML; $.post(OC.filePath('files_trashbin','ajax','delete.php'), - {files:tr.attr('data-file'), dirlisting:tr.attr('data-dirlisting') }, + {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') }, function(result){ for (var i = 0; i < result.data.success.length; i++) { var row = document.getElementById(result.data.success[i].filename); @@ -93,7 +95,7 @@ $(document).ready(function() { $('.undelete').click('click',function(event) { var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var files=getSelectedFiles('file'); - var fileslist=files.join('|'); + var fileslist = JSON.stringify(files); var dirlisting=getSelectedFiles('dirlisting')[0]; for (var i in files) { @@ -118,7 +120,7 @@ $(document).ready(function() { console.log("delete selected"); var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'Delete permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; var files=getSelectedFiles('file'); - var fileslist=files.join('|'); + var fileslist = JSON.stringify(files); var dirlisting=getSelectedFiles('dirlisting')[0]; for (var i in files) { |