summaryrefslogtreecommitdiffstats
path: root/apps/files
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
parentd9e8ebabdcd99bade4201d6be82e1841d30c5d65 (diff)
downloadnextcloud-server-224b80f906c1b7cd6338854e58f228eff4ea871c.tar.gz
nextcloud-server-224b80f906c1b7cd6338854e58f228eff4ea871c.zip
move isMimeSupported out of template files
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/index.php1
-rw-r--r--apps/files/templates/part.list.php6
2 files changed, 4 insertions, 3 deletions
diff --git a/apps/files/index.php b/apps/files/index.php
index c05c2a9384d..3007f56e024 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -74,6 +74,7 @@ foreach ($content as $i) {
}
}
$i['directory'] = $dir;
+ $i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($i['mimetype']);
$files[] = $i;
}
diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php
index 899fb04e252..c91dda4c77e 100644
--- a/apps/files/templates/part.list.php
+++ b/apps/files/templates/part.list.php
@@ -26,7 +26,7 @@ $totalsize = 0; ?>
data-mime="<?php p($file['mimetype'])?>"
data-size="<?php p($file['size']);?>"
data-permissions="<?php p($file['permissions']); ?>">
- <?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?>
+ <?php if($file['isPreviewAvailable']): ?>
<td class="filename svg preview-icon"
<?php else: ?>
<td class="filename svg"
@@ -38,13 +38,13 @@ $totalsize = 0; ?>
<?php
$relativePath = substr($relativePath, strlen($_['sharingroot']));
?>
- <?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?>
+ <?php if($file['isPreviewAvailable']): ?>
style="background-image:url(<?php print_unescaped(OCP\publicPreview_icon($relativePath, $_['sharingtoken'])); ?>)"
<?php else: ?>
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
<?php endif; ?>
<?php else: ?>
- <?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?>
+ <?php if($file['isPreviewAvailable']): ?>
style="background-image:url(<?php print_unescaped(OCP\preview_icon($relativePath)); ?>)"
<?php else: ?>
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"