summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2013-08-21 15:55:59 +0200
committerGeorg Ehrke <developer@georgehrke.com>2013-08-21 15:55:59 +0200
commit224b80f906c1b7cd6338854e58f228eff4ea871c (patch)
tree975007c7e7938484c3c61faad21cbed17ca84440 /apps/files_trashbin
parentd9e8ebabdcd99bade4201d6be82e1841d30c5d65 (diff)
downloadnextcloud-server-224b80f906c1b7cd6338854e58f228eff4ea871c.tar.gz
nextcloud-server-224b80f906c1b7cd6338854e58f228eff4ea871c.zip
move isMimeSupported out of template files
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/index.php1
-rw-r--r--apps/files_trashbin/templates/part.list.php8
2 files changed, 7 insertions, 2 deletions
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php
index 2dbaefe7a78..6ae238eb8eb 100644
--- a/apps/files_trashbin/index.php
+++ b/apps/files_trashbin/index.php
@@ -64,6 +64,7 @@ foreach ($result as $r) {
$i['directory'] = '';
}
$i['permissions'] = OCP\PERMISSION_READ;
+ $i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($r['mime']);
$files[] = $i;
}
diff --git a/apps/files_trashbin/templates/part.list.php b/apps/files_trashbin/templates/part.list.php
index 6c6d2162846..f7cc6b01bbb 100644
--- a/apps/files_trashbin/templates/part.list.php
+++ b/apps/files_trashbin/templates/part.list.php
@@ -21,12 +21,16 @@
data-timestamp='<?php p($file['timestamp']);?>'
data-dirlisting=0
<?php endif; ?>>
+ <?php if($file['isPreviewAvailable']): ?>
+ <td class="filename svg preview-icon"
+ <?php else: ?>
<td class="filename svg"
+ <?php endif; ?>
<?php if($file['type'] === 'dir'): ?>
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)"
<?php else: ?>
- <?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?>
- style="background-image:url(<?php print_unescaped(OCA\Files_Trashbin\Trashbin::preview_icon(!$_['dirlisting'] ? ($file['name'].'.d'.$file['timestamp']) : ($file['directory'].'/'.$file['name']))); ?>)" class="preview-icon"
+ <?php if($file['isPreviewAvailable']): ?>
+ style="background-image:url(<?php print_unescaped(OCA\Files_Trashbin\Trashbin::preview_icon(!$_['dirlisting'] ? ($file['name'].'.d'.$file['timestamp']) : ($file['directory'].'/'.$file['name']))); ?>)"
<?php else: ?>
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
<?php endif; ?>