Sort People tags descending; Albums ascending.

This commit is contained in:
Aaron van Geffen 2016-11-24 16:17:52 +01:00
parent 9f92ed6d7a
commit 1623a430e5

View File

@ -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);