forked from Public/pics
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();
|
$contributors = $tag->getContributorList();
|
||||||
|
|
||||||
// Enumerate possible filters
|
// 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)
|
foreach ($contributors as $contributor)
|
||||||
{
|
{
|
||||||
$filters[$contributor['slug']] = [
|
$filters[$contributor['slug']] = [
|
||||||
@ -57,6 +60,7 @@ class ViewPhotoAlbum extends HTMLController
|
|||||||
'link' => $tag->getUrl() . '/?by=' . $contributor['slug'],
|
'link' => $tag->getUrl() . '/?by=' . $contributor['slug'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Limit to a particular uploader?
|
// Limit to a particular uploader?
|
||||||
$active_filter = '';
|
$active_filter = '';
|
||||||
|
@ -28,6 +28,8 @@ class AlbumButtonBox extends Template
|
|||||||
echo '
|
echo '
|
||||||
<a class="btn btn-light" href="', $button['url'], '">', $button['caption'], '</a>';
|
<a class="btn btn-light" href="', $button['url'], '">', $button['caption'], '</a>';
|
||||||
|
|
||||||
|
if (!empty($this->filters))
|
||||||
|
{
|
||||||
echo '
|
echo '
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
<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 '
|
echo '
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user