diff --git a/controllers/ViewPhotoAlbum.php b/controllers/ViewPhotoAlbum.php index 9dae53cf..8a4131b8 100644 --- a/controllers/ViewPhotoAlbum.php +++ b/controllers/ViewPhotoAlbum.php @@ -39,6 +39,7 @@ class ViewPhotoAlbum extends HTMLController { $back_link = BASEURL . '/people/'; $back_link_title = 'Back to "People"'; + $is_person = true; } $header_box = new AlbumHeaderBox($title, $description, $back_link, $back_link_title); @@ -84,7 +85,7 @@ class ViewPhotoAlbum extends HTMLController } // Load a photo mosaic for the current tag. - list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $page); + list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $page, !isset($is_person)); if (isset($mosaic)) { $index = new PhotosIndex($mosaic, Registry::get('user')->isAdmin()); @@ -111,13 +112,13 @@ class ViewPhotoAlbum extends HTMLController ($page > 1 ? 'page/' . $page . '/' : '')); } - public function getPhotoMosaic($id_tag, $page) + public function getPhotoMosaic($id_tag, $page, $sort_linear) { // Create an iterator. list($this->iterator, $total_count) = AssetIterator::getByOptions([ 'id_tag' => $id_tag, 'order' => 'date_captured', - 'direction' => $id_tag > 0 ? 'asc' : 'desc', + 'direction' => $sort_linear ? 'asc' : 'desc', 'limit' => self::PER_PAGE, 'page' => $page, ], true);