Allow users to filter albums by contributors #48

Merged
Roflin merged 18 commits from refactor/viewalbum into master 2024-01-20 20:11:18 +01:00
Showing only changes of commit 5d990501f6 - Show all commits

View File

@ -89,8 +89,11 @@ class ViewPhotoAlbum extends HTMLController
$this->page->adopt($index); $this->page->adopt($index);
} }
// Are we viewing a person tag?
$is_person = $tag->kind === 'Person';
Aaron marked this conversation as resolved Outdated

$is_person is never set

(At $employer we had the convention to always use !== null instead of isset when you expect the variable to exist to catch these kind of errors. empty() was also discouraged for this reason)

`$is_person` is never set (At $employer we had the convention to always use `!== null` instead of `isset` when you expect the variable to exist to catch these kind of errors. `empty()` was also discouraged for this reason)
Outdated
Review

Yeah, I don't like this either. I've opted instead to explicitly declare it as a boolean before it's used.

Yeah, I don't like this either. I've opted instead to explicitly declare it as a boolean before it's used.
// Load a photo mosaic for the current tag. // Load a photo mosaic for the current tag.
list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $id_user_uploaded, $current_page, !isset($is_person)); list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $id_user_uploaded, $current_page, !$is_person);
if (isset($mosaic)) if (isset($mosaic))
{ {
$index = new PhotosIndex($mosaic, Registry::get('user')->isAdmin()); $index = new PhotosIndex($mosaic, Registry::get('user')->isAdmin());
@ -235,7 +238,6 @@ class ViewPhotoAlbum extends HTMLController
{ {
Aaron marked this conversation as resolved
Review

Unused here

Unused here
$back_link = BASEURL . '/people/'; $back_link = BASEURL . '/people/';
$back_link_title = 'Back to "People"'; $back_link_title = 'Back to "People"';
$is_person = true;
} }
$description = !empty($tag->description) ? $tag->description : ''; $description = !empty($tag->description) ? $tag->description : '';