From 0be9de5df558232e12e2f582af5d08e1f488ba90 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 28 Oct 2013 20:22:06 +0100 Subject: Files, trashbin, public apps use ajax/JSON for the file list 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 --- apps/files/lib/app.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'apps/files/lib/app.php') diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php index fea88faa92a..adfca669577 100644 --- a/apps/files/lib/app.php +++ b/apps/files/lib/app.php @@ -84,25 +84,7 @@ class App { ) { // successful rename $meta = $this->view->getFileInfo($dir . '/' . $newname); - if ($meta['mimetype'] === 'httpd/unix-directory') { - $meta['type'] = 'dir'; - } - else { - $meta['type'] = 'file'; - } - // these need to be set for determineIcon() - $meta['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($meta['mimetype']); - $meta['directory'] = $dir; - $fileinfo = array( - 'id' => $meta['fileid'], - 'mime' => $meta['mimetype'], - 'size' => $meta['size'], - 'etag' => $meta['etag'], - 'directory' => $meta['directory'], - 'name' => $newname, - 'isPreviewAvailable' => $meta['isPreviewAvailable'], - 'icon' => \OCA\Files\Helper::determineIcon($meta) - ); + $fileinfo = \OCA\Files\Helper::formatFileInfo($meta); $result['success'] = true; $result['data'] = $fileinfo; } else { -- cgit v1.2.3