Download: allow limiting by user uploaded as well

This commit is contained in:
2024-01-15 11:40:33 +01:00
parent ec2d702a0d
commit 4b289a5e83
2 changed files with 15 additions and 6 deletions

View File

@@ -79,7 +79,7 @@ class ViewPhotoAlbum extends HTMLController
}
// Add an interface to query and modify the album/tag
$buttons = $this->getAlbumButtons($tag);
$buttons = $this->getAlbumButtons($tag, $active_filter);
$button_strip = new AlbumButtonBox($buttons, $filters, $active_filter);
$this->page->adopt($button_strip);
@@ -174,15 +174,16 @@ class ViewPhotoAlbum extends HTMLController
return $albums;
}
private function getAlbumButtons(Tag $tag)
private function getAlbumButtons(Tag $tag, $active_filter)
{
$buttons = [];
$user = Registry::get('user');
if ($user->isLoggedIn())
{
$suffix = !empty($active_filter) ? '&by=' . $active_filter : '';
$buttons[] = [
'url' => BASEURL . '/download/?tag=' . $tag->id_tag,
'url' => BASEURL . '/download/?tag=' . $tag->id_tag . $suffix,
'caption' => 'Download album',
];
}