forked from Public/pics
ViewPhotoAlbum: don't populate filter box if there are no album contributors
This commit is contained in:
@@ -28,26 +28,31 @@ class AlbumButtonBox extends Template
|
||||
echo '
|
||||
<a class="btn btn-light" href="', $button['url'], '">', $button['caption'], '</a>';
|
||||
|
||||
echo '
|
||||
if (!empty($this->filters))
|
||||
{
|
||||
echo '
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="bi bi-filter"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu">';
|
||||
|
||||
foreach ($this->filters as $key => $filter)
|
||||
{
|
||||
$is_active = $key === $this->active_filter;
|
||||
echo '
|
||||
foreach ($this->filters as $key => $filter)
|
||||
{
|
||||
$is_active = $key === $this->active_filter;
|
||||
echo '
|
||||
<li><a class="dropdown-item', $is_active ? ' active' : '',
|
||||
'" href="', $filter['link'], '">',
|
||||
$filter['caption'],
|
||||
'</a></li>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user