mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
Files app: - removed file list template, now rendering list from JSON response - FileList.addFile/addDir is now FileList.add() and takes a JS map with all required arguments instead of having a long number of function arguments - added unit tests for many FileList operations - fixed newfile.php, newfolder.php and rename.php to return the file's full JSON on success - removed obsolete/unused undo code - removed download_url / loading options, now using Files.getDownloadUrl() for that - server side now uses Helper::getFileInfo() to prepare file JSON response - previews are now client-side only Breadcrumbs are now JS only: - Added BreadCrumb class to handle breadcrumb rendering and events - Added unit test for BreadCrumb class - Moved all relevant JS functions to the BreadCrumb class Public page now uses ajax to load the file list: - Added Helper class in sharing app to make it easier to authenticate and retrieve the file's real path - Added ajax/list.php to retrieve the file list - Fixed FileActions and FileList to work with the ajax list Core: - Fixed file picker dialog to use the same list format as files app
27 lines
668 B
PHP
27 lines
668 B
PHP
<?php
|
|
|
|
OCP\JSON::checkLoggedIn();
|
|
\OC::$session->close();
|
|
|
|
// Load the files
|
|
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
|
|
$dir = \OC\Files\Filesystem::normalizePath($dir);
|
|
$dirInfo = \OC\Files\Filesystem::getFileInfo($dir);
|
|
if (!$dirInfo->getType() === 'dir') {
|
|
header("HTTP/1.0 404 Not Found");
|
|
exit();
|
|
}
|
|
|
|
$data = array();
|
|
$baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir=';
|
|
|
|
$permissions = $dirInfo->getPermissions();
|
|
|
|
// make filelist
|
|
$files = \OCA\Files\Helper::getFiles($dir);
|
|
|
|
$data['directory'] = $dir;
|
|
$data['files'] = \OCA\Files\Helper::formatFileInfos($files);
|
|
$data['permissions'] = $permissions;
|
|
|
|
OCP\JSON::success(array('data' => $data));
|