fix restore from files in sub-folders

This commit is contained in:
Bjoern Schiessle 2013-11-29 16:43:50 +01:00
parent 41a1a32e5a
commit 71589e65d2
2 changed files with 3 additions and 2 deletions

View file

@ -13,6 +13,7 @@ $success = array();
$i = 0; $i = 0;
foreach ($list as $file) { foreach ($list as $file) {
if ( $dirlisting === '0') { if ( $dirlisting === '0') {
$file = ltrim($file, '/');
$delimiter = strrpos($file, '.d'); $delimiter = strrpos($file, '.d');
$filename = substr($file, 0, $delimiter); $filename = substr($file, 0, $delimiter);
$timestamp = substr($file, $delimiter+2); $timestamp = substr($file, $delimiter+2);

View file

@ -8,7 +8,7 @@ $(document).ready(function() {
deleteAction.removeClass('delete-icon').addClass('progress-icon'); deleteAction.removeClass('delete-icon').addClass('progress-icon');
disableActions(); disableActions();
$.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'),
{files: JSON.stringify([filename]), dirlisting: tr.attr('data-dirlisting')}, {files: JSON.stringify([$('#dir').val() + '/' + filename]), dirlisting: tr.attr('data-dirlisting')},
function(result) { function(result) {
for (var i = 0; i < result.data.success.length; i++) { for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename); var row = document.getElementById(result.data.success[i].filename);
@ -229,7 +229,7 @@ function getSelectedFiles(property){
elements.each(function(i,element){ elements.each(function(i,element){
var file={ var file={
name:$(element).attr('data-filename'), name:$(element).attr('data-filename'),
file:$(element).attr('data-file'), file:$('#dir').val() + "/" + $(element).attr('data-file'),
timestamp:$(element).attr('data-timestamp'), timestamp:$(element).attr('data-timestamp'),
type:$(element).attr('data-type'), type:$(element).attr('data-type'),
dirlisting:$(element).attr('data-dirlisting') dirlisting:$(element).attr('data-dirlisting')