diff options
Diffstat (limited to 'apps/files/ajax')
-rw-r--r-- | apps/files/ajax/rawlist.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php index e9ae1f5305f..9ccd4cc299a 100644 --- a/apps/files/ajax/rawlist.php +++ b/apps/files/ajax/rawlist.php @@ -25,8 +25,10 @@ $files = array(); // If a type other than directory is requested first load them. if($mimetypes && !in_array('httpd/unix-directory', $mimetypes)) { foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, 'httpd/unix-directory' ) as $file ) { + $file['directory'] = $dir; + $file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']); $file["date"] = OCP\Util::formatDate($file["mtime"]); - $file['mimetype_icon'] = \mimetype_icon('dir'); + $file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file); $files[] = $file; } } @@ -34,23 +36,19 @@ if($mimetypes && !in_array('httpd/unix-directory', $mimetypes)) { if (is_array($mimetypes) && count($mimetypes)) { foreach ($mimetypes as $mimetype) { foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, $mimetype ) as $file ) { + $file['directory'] = $dir; + $file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']); $file["date"] = OCP\Util::formatDate($file["mtime"]); - if ($file['type'] === "dir") { - $file['mimetype_icon'] = \mimetype_icon('dir'); - } else { - $file['mimetype_icon'] = \mimetype_icon($file['mimetype']); - } + $file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file); $files[] = $file; } } } else { foreach( \OC\Files\Filesystem::getDirectoryContent( $dir ) as $file ) { + $file['directory'] = $dir; + $file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']); $file["date"] = OCP\Util::formatDate($file["mtime"]); - if ($file['type'] === "dir") { - $file['mimetype_icon'] = \mimetype_icon('dir'); - } else { - $file['mimetype_icon'] = \mimetype_icon($file['mimetype']); - } + $file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file); $files[] = $file; } } |