From 224b80f906c1b7cd6338854e58f228eff4ea871c Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 21 Aug 2013 15:55:59 +0200 Subject: [PATCH] move isMimeSupported out of template files --- apps/files/index.php | 1 + apps/files/templates/part.list.php | 6 +++--- apps/files_sharing/public.php | 1 + apps/files_trashbin/index.php | 1 + apps/files_trashbin/templates/part.list.php | 8 ++++++-- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/files/index.php b/apps/files/index.php index c05c2a9384..3007f56e02 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 899fb04e25..c91dda4c77 100644 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -26,7 +26,7 @@ $totalsize = 0; ?> data-mime="" data-size="" data-permissions=""> - + - + style="background-image:url()" style="background-image:url()" - + style="background-image:url()" style="background-image:url()" diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index f050fecd7b..ec6b4e815f 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -172,6 +172,7 @@ if (isset($path)) { } else { $i['extension'] = ''; } + $i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($i['mimetype']); } $i['directory'] = $getPath; $i['permissions'] = OCP\PERMISSION_READ; diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index 2dbaefe7a7..6ae238eb8e 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 6c6d216284..f7cc6b01bb 100644 --- a/apps/files_trashbin/templates/part.list.php +++ b/apps/files_trashbin/templates/part.list.php @@ -21,12 +21,16 @@ data-timestamp='' data-dirlisting=0 > + + style="background-image:url()" - - style="background-image:url()" class="preview-icon" + + style="background-image:url()" style="background-image:url()"