forked from Public/pics
Download: allow limiting by user uploaded as well
This commit is contained in:
@@ -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',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user