PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.36
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.36
3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 2.44 All 141 releases
photonic / Components / Photo_List.php

Photo_List.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.36, at Components/Photo_List.php

50 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Photonic_Plugin\Components;
4
5 use Photonic_Plugin\Core\Photonic;
6 use Photonic_Plugin\Layouts\Core_Layout;
7 use Photonic_Plugin\Platforms\Base;
8
9 require_once 'Header.php';
10 require_once 'Pagination.php';
11
12 class Photo_List implements Printable {
13 public array $photos = [];
14
15 public string $title_position = 'tooltip';
16 public array $row_constraints = [];
17 public string $parent = 'stream';
18 public string $indent = "\t";
19 public array $short_code = [];
20
21 /**
22 * @var Pagination $pagination
23 */
24 public Pagination $pagination;
25
26 public function __construct(array $short_code) {
27 $this->short_code = $short_code;
28 $this->pagination = new Pagination();
29 }
30
31 private function custom_sort(Base $module) {
32 $this->photos = apply_filters('photonic_custom_sort_photos', $this->photos, $module->provider);
33 }
34
35 public function html(Base $module, Core_Layout $layout, bool $print = false): string {
36 $ret = '';
37
38 $this->custom_sort($module);
39
40 if (is_a($layout, 'Photonic_Plugin\Layouts\Level_One_Gallery')) {
41 $ret = $layout->generate_level_1_gallery($this, $this->short_code, $module);
42 }
43
44 if ($print) {
45 echo wp_kses($ret, Photonic::$safe_tags);
46 }
47 return wp_kses($ret, Photonic::$safe_tags);
48 }
49 }
50