albums = $albums; $this->show_edit_buttons = $show_edit_buttons; $this->show_labels = $show_labels; } public function html_main() { echo '
'; foreach ($this->albums as $album) $this->renderAlbum($album); echo '
'; } private function renderAlbum(array $album) { echo '
'; if ($this->show_edit_buttons) echo ' Edit'; echo ' '; if (isset($album['thumbnail'])) { $thumbs = []; foreach ([1, 2] as $factor) $thumbs[$factor] = $album['thumbnail']->getThumbnailUrl( static::TILE_WIDTH * $factor, static::TILE_HEIGHT * $factor, true, true); foreach (['normal-photo', 'blur-photo'] as $className) { echo ' '; } } else { echo ' '; } if ($this->show_labels) echo '

', $album['caption'], '

'; echo '
'; } }