mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
feature #379, multiple format, consider the original as a format
This commit is contained in:
+15
-2
@@ -674,10 +674,23 @@ SELECT *
|
||||
|
||||
if (!empty($formats))
|
||||
{
|
||||
// let's add the original as a format among others. It will just have
|
||||
// a specific download URL
|
||||
array_unshift(
|
||||
$formats,
|
||||
array(
|
||||
'download_url' => $picture['current']['download_url'],
|
||||
'ext' => get_extension($picture['current']['file']),
|
||||
'filesize' => $picture['current']['filesize'],
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($formats as &$format)
|
||||
{
|
||||
$format['download_url'] = 'action.php?format='.$format['format_id'];
|
||||
$format['download_url'].= '&download';
|
||||
if (!isset($format['download_url']))
|
||||
{
|
||||
$format['download_url'] = 'action.php?format='.$format['format_id'].'&download';
|
||||
}
|
||||
|
||||
$format['label'] = strtoupper($format['ext']);
|
||||
$lang_key = 'format '.strtoupper($format['ext']);
|
||||
|
||||
@@ -81,7 +81,6 @@ jQuery().ready(function() {
|
||||
<div id="downloadSwitchBox" class="switchBox">
|
||||
<div class="switchBoxTitle">{'Download'|translate} - {'Formats'|translate}</div>
|
||||
<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.label}<span class="downloadformatDetails"> ({$format.filesize})</span></a></li>
|
||||
{/foreach}
|
||||
|
||||
Reference in New Issue
Block a user