From 9fcde24c39ccf7caa181be4931943804f7c4a34a Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sat, 1 Apr 2023 14:53:40 +0200 Subject: [PATCH] PhotosIndex: reintroduce alternating odd/even layouts --- templates/PhotosIndex.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/templates/PhotosIndex.php b/templates/PhotosIndex.php index 499038b1..196e870c 100644 --- a/templates/PhotosIndex.php +++ b/templates/PhotosIndex.php @@ -51,7 +51,7 @@ class PhotosIndex extends Template { list($photos, $what) = $row; $this->header($photos); - $this->$what($photos); + $this->$what($photos, $i % 2); } echo ' @@ -115,7 +115,7 @@ class PhotosIndex extends Template '; } - protected function panorama(array $photos) + protected function panorama(array $photos, $altLayout) { foreach ($photos as $image) { @@ -131,12 +131,13 @@ class PhotosIndex extends Template } } - protected function portrait(array $photos) + protected function portrait(array $photos, $altLayout) { $image = array_shift($photos); echo ' -
+
'; $this->photo($image, 'portrait', static::PORTRAIT_WIDTH, static::PORTRAIT_HEIGHT, 'centre'); @@ -163,12 +164,13 @@ class PhotosIndex extends Template
'; } - protected function landscape(array $photos) + protected function landscape(array $photos, $altLayout) { $image = array_shift($photos); echo ' -
+
'; $this->photo($image, 'landscape', static::LANDSCAPE_WIDTH, static::LANDSCAPE_HEIGHT, 'top'); @@ -195,7 +197,7 @@ class PhotosIndex extends Template
'; } - protected function duo(array $photos) + protected function duo(array $photos, $altLayout) { echo '
'; @@ -215,7 +217,7 @@ class PhotosIndex extends Template
'; } - protected function single(array $photos) + protected function single(array $photos, $altLayout) { echo '
@@ -229,7 +231,7 @@ class PhotosIndex extends Template
'; } - protected function landscapes(array $photos) + protected function landscapes(array $photos, $altLayout) { echo '
'; @@ -249,7 +251,7 @@ class PhotosIndex extends Template
'; } - protected function portraits(array $photos) + protected function portraits(array $photos, $altLayout) { echo '
';