Blame view
sources/apps/files_trashbin/ajax/list.php
703 Bytes
|
31b7f2792
|
1 |
<?php |
|
31b7f2792
|
2 3 4 5 |
OCP\JSON::checkLoggedIn(); // Load the files $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; |
|
6d9380f96
|
6 7 |
$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name'; $sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false; |
|
31b7f2792
|
8 |
$data = array(); |
|
31b7f2792
|
9 |
// make filelist |
|
6d9380f96
|
10 11 12 |
try {
$files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir, \OCP\User::getUser(), $sortAttribute, $sortDirection);
} catch (Exception $e) {
|
|
31b7f2792
|
13 14 15 |
header("HTTP/1.0 404 Not Found");
exit();
}
|
|
31b7f2792
|
16 |
$encodedDir = \OCP\Util::encodePath($dir); |
|
6d9380f96
|
17 18 19 20 |
$data['permissions'] = 0; $data['directory'] = $dir; $data['files'] = \OCA\Files_Trashbin\Helper::formatFileInfos($files); |
|
31b7f2792
|
21 22 |
OCP\JSON::success(array('data' => $data));
|