forked from Public/pics
PhotoMosaic: allow sets of three portraits.
This commit is contained in:
parent
df7655e00b
commit
7240201a3e
@ -115,6 +115,10 @@ class PhotoMosaic
|
|||||||
// Sort photos by priority and date captured.
|
// Sort photos by priority and date captured.
|
||||||
usort($photos, 'self::orderPhotos');
|
usort($photos, 'self::orderPhotos');
|
||||||
|
|
||||||
|
// Three portraits?
|
||||||
|
if ($num_portrait === 3)
|
||||||
|
return [$photos, 'portraits'];
|
||||||
|
|
||||||
// At least one portrait?
|
// At least one portrait?
|
||||||
if ($num_portrait >= 1)
|
if ($num_portrait >= 1)
|
||||||
{
|
{
|
||||||
|
@ -241,4 +241,24 @@ class PhotosIndex extends SubTemplate
|
|||||||
echo '
|
echo '
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function portraits(array $photos)
|
||||||
|
{
|
||||||
|
echo '
|
||||||
|
<div class="tiled_row">';
|
||||||
|
|
||||||
|
foreach ($photos as $image)
|
||||||
|
{
|
||||||
|
echo '
|
||||||
|
<div style="border-color: #', $this->color($image), '" class="portrait">';
|
||||||
|
|
||||||
|
$this->photo($image, static::PORTRAIT_WIDTH, static::PORTRAIT_HEIGHT, true);
|
||||||
|
|
||||||
|
echo '
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user