feature #379, multiple format, consider the original as a format

This commit is contained in:
plegall
2015-12-22 19:04:00 +01:00
parent 6e2a4495bf
commit e439de1612
2 changed files with 15 additions and 3 deletions

View File

@@ -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']);