ViewPhotoAlbum: don't populate filter box if there are no album contributors
This commit is contained in:
@@ -47,15 +47,19 @@ class ViewPhotoAlbum extends HTMLController
|
||||
$contributors = $tag->getContributorList();
|
||||
|
||||
// Enumerate possible filters
|
||||
$filters = ['' => ['id_user' => null, 'caption' => 'Show all photos', 'link' => $tag->getUrl()]];
|
||||
foreach ($contributors as $contributor)
|
||||
$filters = [];
|
||||
if (!empty($contributors))
|
||||
{
|
||||
$filters[$contributor['slug']] = [
|
||||
'id_user' => $contributor['id_user'],
|
||||
'caption' => sprintf('By %s (%s photos)',
|
||||
$contributor['first_name'], $contributor['num_assets']),
|
||||
'link' => $tag->getUrl() . '/?by=' . $contributor['slug'],
|
||||
];
|
||||
$filters[''] = ['id_user' => null, 'caption' => 'Show all photos', 'link' => $tag->getUrl()];
|
||||
foreach ($contributors as $contributor)
|
||||
{
|
||||
$filters[$contributor['slug']] = [
|
||||
'id_user' => $contributor['id_user'],
|
||||
'caption' => sprintf('By %s (%s photos)',
|
||||
$contributor['first_name'], $contributor['num_assets']),
|
||||
'link' => $tag->getUrl() . '/?by=' . $contributor['slug'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Limit to a particular uploader?
|
||||
|
||||
Reference in New Issue
Block a user