# photonic/3.36/Components/Collection.php

Photonic Gallery &amp; Lightbox for Flickr, SmugMug &amp; Others, version 3.36. 65 lines.

- Page: https://pluginprobe.com/plugins/photonic/3.36/code/Components/Collection.php
- Raw: https://pluginprobe.com/plugins/photonic/3.36/raw/Components/Collection.php
- Modified: 2026-07-23T21:21:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/photonic/3.36/code/Components/Collection.php#L10-L20`.

```php
<?php

namespace Photonic_Plugin\Components;

use Photonic_Plugin\Core\Photonic;
use Photonic_Plugin\Layouts\Core_Layout;
use Photonic_Plugin\Platforms\Base;

class Collection implements Printable {
	/**
	 * @var Header|null $header
	 */
	public ?Header $header = null;

	/**
	 * @var Album_List|null $album_list
	 */
	public ?Album_List $album_list = null;

	/**
	 * @var array
	 */
	public array $collections = [];

	public string $indent = '';
	public bool $strip_top_level = false; // Specifically for Flickr, when you do lazy loading

	/**
	 * {@inheritDoc} - a Collection
	 */
	public function html(Base $module, Core_Layout $layout, bool $print = false): string {
		$start = empty($this->strip_top_level) ? $this->indent . "<div class='photonic-tree'>\n" : '';
		$out = $start;

		if (!empty($this->header)) {
			$out .= $this->header->html($module, $layout);
		}

		if (!empty($this->album_list)) {
			$out .= $this->album_list->html($module, $layout);
		}

		if (!empty($this->collections)) {
			/** @var Printable|string $collection */
			foreach ($this->collections as $collection) {
				if (is_a($collection, 'Photonic_Plugin\Components\Printable')) {
					$out .= $collection->html($module, $layout);
				}
				else {
					$out .= $collection;
				}
			}
		}

		if ($out !== $start && !$this->strip_top_level) {
			$out .= $this->indent . "</div>\n";
		}

		if ($print) {
			echo wp_kses($out, Photonic::$safe_tags);
		}
		return wp_kses($out, Photonic::$safe_tags);
	}
}

```
