aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2015-12-20 15:44:01 +0100
committerplegall <plg@piwigo.org>2015-12-20 15:44:01 +0100
commit89bc74b3f30e169ab51e5b2728767f02a94a991c (patch)
tree417a9d1369699139eeb5dca05782e00d0572e2cb
parent0f8d85491f656440e7cc66ecca70f7af8dff0022 (diff)
feature #379, multiple format, labels
Ability to customize, with $lang['format CR2'] = 'RAW Canon' (in LocalFiles Editor) for example
-rw-r--r--picture.php7
-rw-r--r--themes/default/template/picture.tpl2
2 files changed, 8 insertions, 1 deletions
diff --git a/picture.php b/picture.php
index f2dfecf0e..093e4b271 100644
--- a/picture.php
+++ b/picture.php
@@ -679,6 +679,13 @@ SELECT *
$format['download_url'] = 'action.php?format='.$format['format_id'];
$format['download_url'].= '&amp;download='.substr(md5(time()), 0, 6); // a random string to avoid browser cache
+ $format['label'] = strtoupper($format['ext']);
+ $lang_key = 'format '.strtoupper($format['ext']);
+ if (isset($lang[$lang_key]))
+ {
+ $format['label'] = $lang[$lang_key];
+ }
+
$format['filesize'] = sprintf('%.1fMB', $format['filesize']/1024);
}
}
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl
index c576748fb..f18fdd615 100644
--- a/themes/default/template/picture.tpl
+++ b/themes/default/template/picture.tpl
@@ -95,7 +95,7 @@ jQuery().ready(function() {
<ul>
<li><a href="{$current.U_DOWNLOAD}" rel="nofollow">{'Original'|@translate}</a></li>
{foreach from=$current.formats item=format}
- <li><a href="{$format.download_url}" rel="nofollow">{$format.ext|upper}<span class="downloadformatDetails"> ({$format.filesize})</span></a></li>
+ <li><a href="{$format.download_url}" rel="nofollow">{$format.label}<span class="downloadformatDetails"> ({$format.filesize})</span></a></li>
{/foreach}
</ul>
</div>