ViewPhotoAlbum: don't populate filter box if there are no album contributors
This commit is contained in:
parent
99b867b241
commit
9c00248a7f
@ -47,7 +47,10 @@ class ViewPhotoAlbum extends HTMLController
|
||||
$contributors = $tag->getContributorList();
|
||||
|
||||
// Enumerate possible filters
|
||||
$filters = ['' => ['id_user' => null, 'caption' => 'Show all photos', 'link' => $tag->getUrl()]];
|
||||
$filters = [];
|
||||
if (!empty($contributors))
|
||||
{
|
||||
$filters[''] = ['id_user' => null, 'caption' => 'Show all photos', 'link' => $tag->getUrl()];
|
||||
foreach ($contributors as $contributor)
|
||||
{
|
||||
$filters[$contributor['slug']] = [
|
||||
@ -57,6 +60,7 @@ class ViewPhotoAlbum extends HTMLController
|
||||
'link' => $tag->getUrl() . '/?by=' . $contributor['slug'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Limit to a particular uploader?
|
||||
$active_filter = '';
|
||||
|
@ -28,6 +28,8 @@ class AlbumButtonBox extends Template
|
||||
echo '
|
||||
<a class="btn btn-light" href="', $button['url'], '">', $button['caption'], '</a>';
|
||||
|
||||
if (!empty($this->filters))
|
||||
{
|
||||
echo '
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
@ -47,7 +49,10 @@ class AlbumButtonBox extends Template
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user