Refactor ViewPhotoAlbum a little to clean up the code
Add a method to enumerate contributors
Add a method to safely filter by contributor
Add a UI for users to select an available filter
Carry filter over to photo page (e.g. ?by, analogous to ?in)
Take active filter into account when generating previous/next photo url
Carry filter over to download page
Test things thoroughly
- [x] Refactor ViewPhotoAlbum a little to clean up the code
- [x] Add a method to enumerate contributors
- [x] Add a method to safely filter by contributor
- [x] Add a UI for users to select an available filter
- [x] Carry filter over to photo page (e.g. `?by`, analogous to `?in`)
- [x] Take active filter into account when generating previous/next photo url
- [x] Carry filter over to download page
- [x] Test things thoroughly
(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)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
?by, analogous to?in)35cb6798c8to1f53689e4bFixes #13
@@ -66,0 +50,4 @@$filters = [];if (!empty($contributors)){$filters[''] = ['id_user' => null, 'caption' => 'Show all photos', 'link' => $tag->getUrl()];Key
labelmissingI initially didn't add it as it'd never be used. You're right, though, and it's better to just have it there for consistency.
@@ -74,3 +91,3 @@// Load a photo mosaic for the current tag.list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $page, !isset($is_person));list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $id_user_uploaded, $current_page, !isset($is_person));$is_personis never set(At $employer we had the convention to always use
!== nullinstead ofissetwhen you expect the variable to exist to catch these kind of errors.empty()was also discouraged for this reason)Yeah, I don't like this either. I've opted instead to explicitly declare it as a boolean before it's used.
@@ -201,0 +235,4 @@{$back_link = BASEURL . '/people/';$back_link_title = 'Back to "People"';$is_person = true;Unused here
f82bd7b065to30bc0bb884