Rewrite mosaic algorithm using declarative paradigm #42
@ -12,7 +12,6 @@ class PhotosIndex extends Template
|
|||||||
protected $show_edit_buttons;
|
protected $show_edit_buttons;
|
||||||
protected $show_headers;
|
protected $show_headers;
|
||||||
protected $show_labels;
|
protected $show_labels;
|
||||||
protected $row_limit = 1000;
|
|
||||||
protected $previous_header = '';
|
protected $previous_header = '';
|
||||||
protected $url_suffix;
|
protected $url_suffix;
|
||||||
|
|
||||||
@ -47,11 +46,12 @@ class PhotosIndex extends Template
|
|||||||
echo '
|
echo '
|
||||||
<div class="container photo-index">';
|
<div class="container photo-index">';
|
||||||
|
|
||||||
for ($i = $this->row_limit; $i > 0 && $row = $this->mosaic->getRow(); $i--)
|
$i = 0;
|
||||||
|
while ($row = $this->mosaic->getRow())
|
||||||
{
|
{
|
||||||
list($photos, $what) = $row;
|
[$photos, $what] = $row;
|
||||||
$this->header($photos);
|
$this->header($photos);
|
||||||
$this->$what($photos, $i % 2);
|
$this->$what($photos, ($i++) % 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
|
Loading…
Reference in New Issue
Block a user