2013-08-17 15:07:18 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
OCP\JSON::checkLoggedIn();
|
|
|
|
|
|
|
|
// Load the files
|
|
|
|
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
|
|
|
|
$data = array();
|
|
|
|
|
|
|
|
// make filelist
|
2014-02-25 23:46:41 +04:00
|
|
|
try {
|
|
|
|
$files = \OCA\Files_Trashbin\Helper::getTrashFiles($dir);
|
|
|
|
} catch (Exception $e) {
|
2013-08-17 15:07:18 +04:00
|
|
|
header("HTTP/1.0 404 Not Found");
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$encodedDir = \OCP\Util::encodePath($dir);
|
2013-10-28 23:22:06 +04:00
|
|
|
|
|
|
|
$data['permissions'] = 0;
|
|
|
|
$data['directory'] = $dir;
|
|
|
|
$data['files'] = \OCA\Files_Trashbin\Helper::formatFileInfos($files);
|
2013-08-17 15:07:18 +04:00
|
|
|
|
|
|
|
OCP\JSON::success(array('data' => $data));
|
|
|
|
|