summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/ajax/rawlist.php20
-rw-r--r--core/js/oc-dialogs.js6
2 files changed, 10 insertions, 16 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;
}
}
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 61b58d00fa6..33e3a75fab6 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -292,11 +292,7 @@ var OCdialogs = {
filename: entry.name,
date: OC.mtime2date(entry.mtime)
});
- if (entry.mimetype === "httpd/unix-directory") {
- $li.find('img').attr('src', OC.imagePath('core', 'filetypes/folder.png'));
- } else {
- $li.find('img').attr('src', OC.Router.generate('core_ajax_preview', {x:32, y:32, file:escapeHTML(dir+'/'+entry.name)}) );
- }
+ $li.find('img').attr('src', entry.mimetype_icon);
self.$filelist.append($li);
});