diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-02-13 20:20:00 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-02-13 20:28:52 +0100 |
commit | d5397d813cd731b5bf8ac4b7c193ac39d704af6e (patch) | |
tree | 9de3d45f938bdb755ac158933aef994cb58e257e /apps/files/ajax | |
parent | 30662fa7acbe7a367ee8b0c07afabf425a10ef06 (diff) | |
download | nextcloud-server-d5397d813cd731b5bf8ac4b7c193ac39d704af6e.tar.gz nextcloud-server-d5397d813cd731b5bf8ac4b7c193ac39d704af6e.zip |
Do not send file list for select all on Download/delete
- When all files are selected, do not send the whole file list
- Download will trigger download for the parent folder, also works
with root
- Delete will send "allfiles" to the server that will find the file
list or the passed directory by itself
Diffstat (limited to 'apps/files/ajax')
-rw-r--r-- | apps/files/ajax/delete.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php index c69f5a8860c..69f859daa97 100644 --- a/apps/files/ajax/delete.php +++ b/apps/files/ajax/delete.php @@ -9,8 +9,21 @@ OCP\JSON::callCheck(); // Get data $dir = stripslashes($_POST["dir"]); $files = isset($_POST["file"]) ? $_POST["file"] : $_POST["files"]; +$allFiles = isset($_POST["allfiles"]) ? $_POST["allfiles"] : $_POST["allfiles"]; +if ($allFiles === 'true') { + $allFiles = true; +} -$files = json_decode($files); +// delete all files in dir ? +if ($allFiles) { + $files = array(); + $fileList = \OC\Files\Filesystem::getDirectoryContent($dir); + foreach ($fileList as $fileInfo) { + $files[] = $fileInfo['name']; + } +} else { + $files = json_decode($files); +} $filesWithError = ''; $success = true; |