# photonic/3.37/Components/Album_List.php

Photonic Gallery &amp; Lightbox for Flickr, SmugMug &amp; Others, version 3.37. 75 lines.

- Page: https://pluginprobe.com/plugins/photonic/3.37/code/Components/Album_List.php
- Raw: https://pluginprobe.com/plugins/photonic/3.37/raw/Components/Album_List.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.37/code/Components/Album_List.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;

require_once 'Pagination.php';

class Album_List implements Printable {
	public array $albums = [];

	public string $title_position;
	public array $row_constraints = [];
	public string $indent = '';
	public array $short_code = [];

	/**
	 * @var Pagination $pagination
	 */
	public Pagination $pagination;

	public string $type = '';
	public string $singular_type = '';
	public $level_1_count_display;
	public bool $album_opens_gallery = false;

	public array $gallery_attributes = [];

	public function __construct(array $short_code) {
		$this->pagination = new Pagination();
		$this->short_code = $short_code;

		$this->gallery_attributes['photo-count'] = empty($short_code['photo_count']) ? $short_code['count'] : $short_code['photo_count'];

		$data = [
			'photo-more'         => 'photo_more',
			'overlay-size'       => 'overlay_size',
			'overlay-crop'       => 'overlay_crop',
			'overlay-video-size' => 'overlay_video_size',
			'thumb-size'         => 'thumb_size',
		];

		foreach ($data as $attr => $value) {
			if (isset($short_code[$value])) {
				$this->gallery_attributes[$attr] = $short_code[$value];
			}
		}
	}

	private function custom_sort(Base $module) {
		$this->albums = apply_filters('photonic_custom_sort_albums', $this->albums, $module->provider);
	}

	/**
	 * {@inheritDoc}
	 */
	public function html(Base $module, Core_Layout $layout, bool $print = false): string {
		$ret = '';

		$this->custom_sort($module);

		if (is_a($layout, 'Photonic_Plugin\Layouts\Level_Two_Gallery')) {
			$ret = $layout->generate_level_2_gallery($this, $this->short_code, $module);
		}

		if ($print) {
			echo wp_kses($ret, Photonic::$safe_tags);
		}

		return wp_kses($ret, Photonic::$safe_tags);
	}
}

```
