aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-16 19:26:56 -0800
committerzotlabs <mike@macgirvin.com>2017-11-16 19:26:56 -0800
commit7c655c8d61c1210815d024f7945bedf2ae7279fd (patch)
tree7b780d33158cf313f00a18c205cf7e0e44c8d113
parent7386fa57c8fd8422b6aa2c947603c8c2f945ba62 (diff)
downloadvolse-hubzilla-7c655c8d61c1210815d024f7945bedf2ae7279fd.tar.gz
volse-hubzilla-7c655c8d61c1210815d024f7945bedf2ae7279fd.tar.bz2
volse-hubzilla-7c655c8d61c1210815d024f7945bedf2ae7279fd.zip
allow svg image previews in cloud browser when using tile mode.
-rw-r--r--Zotlabs/Storage/Browser.php11
-rw-r--r--view/tpl/cloud_directory.tpl2
2 files changed, 11 insertions, 2 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index b5440aacf..ee5a9fef4 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -197,6 +197,11 @@ class Browser extends DAV\Browser\Plugin {
}
}
+
+ // generate preview icons for tile view.
+ // Currently we only handle images, but this could potentially be extended with plugins
+ // to provide document and video thumbnails
+
$photo_icon = '';
if(strpos($type,'image/') === 0 && $attachHash) {
@@ -206,8 +211,12 @@ class Browser extends DAV\Browser\Plugin {
intval(PHOTO_RES_PROFILE_80)
);
if($r) {
- $photo_icon = $r[0]['resource_id'] . '-' . $r[0]['imgscale'];
+ $photo_icon = 'photo/' . $r[0]['resource_id'] . '-' . $r[0]['imgscale'];
}
+ if($type === 'image/svg+xml') {
+ $photo_icon = $fullPath;
+ }
+
}
$attachIcon = ""; // "<a href=\"attach/".$attachHash."\" title=\"".$displayName."\"><i class=\"fa fa-arrow-circle-o-down\"></i></a>";
diff --git a/view/tpl/cloud_directory.tpl b/view/tpl/cloud_directory.tpl
index 40278661f..3ae8cbf35 100644
--- a/view/tpl/cloud_directory.tpl
+++ b/view/tpl/cloud_directory.tpl
@@ -16,7 +16,7 @@
<div class="cloud-container">
<div class="cloud-icon"><a href="{{$item.fullPath}}">
{{if $item.photo_icon}}
- <img src="photo/{{$item.photo_icon}}" title="{{$item.type}}" >
+ <img src="{{$item.photo_icon}}" title="{{$item.type}}" >
{{else}}
<i class="fa fa-fw {{$item.iconFromType}}" title="{{$item.type}}"></i>
{{/if}}