PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.33
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.33
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 / Admin / Wizard / Screen_Fields.php

Screen_Fields.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.33, at Admin/Wizard/Screen_Fields.php

197 lines 8.1 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\Admin\Wizard;
4
5 use Photonic_Plugin\Core\Utilities;
6
7 /**
8 * Contains the fields used by the gallery builder. Cannot be overridden by a theme file
9 * Screen 1: Provider selection: Pick from Flickr, Google Photos etc.
10 * Screen 2: Display Type selection; Input: Provider. Pick from: Single Photo
11 * Screen 3: Gallery object selection; input: Display Type
12 * Screen 4: Layout selection; input: Gallery & Display Type
13 * Screen 5: Layout configuration; Set <code>count</code>, <code>more</code> etc.
14 * Screen 6: Final shortcode display
15 *
16 * @since 2.00
17 */
18 class Screen_Fields {
19 public array $layout_options;
20 private array $paths;
21
22 public function __construct() {
23 require_once 'Source.php';
24 $this->paths = [
25 'wp' => 'WP.php',
26 'flickr' => 'Flickr.php',
27 'smugmug' => 'SmugMug.php',
28 // 'google' => 'Google_Photos.php',
29 'zenfolio' => 'Zenfolio.php',
30 // 'instagram' => 'Instagram.php',
31 ];
32 $this->layout_options = [
33 'square' => esc_html__('Square Grid', 'photonic'),
34 'circle' => esc_html__('Circular Icon Grid', 'photonic'),
35 'random' => esc_html__('Justified Grid', 'photonic'),
36 'masonry' => esc_html__('Masonry (top-to-bottom ordered)', 'photonic'),
37 'masonry-horizontal' => esc_html__('Horizontal Masonry (left-to-right ordered)', 'photonic'),
38 'mosaic' => esc_html__('Mosaic', 'photonic'),
39 'slideshow' => esc_html__('Slideshow', 'photonic'),
40 ];
41 }
42
43 /**
44 * @return array
45 */
46 public function get_layout_options(): array {
47 return $this->layout_options;
48 }
49
50 /**
51 * @param $provider
52 * @return array
53 */
54 public function get_screen_2_fields($provider): array {
55 $source = $this->get_source($provider);
56 return $source->get_screen_2();
57 }
58
59 public function get_screen_3_fields($provider): array {
60 $source = $this->get_source($provider);
61 return $source->get_screen_3();
62 }
63
64 public function get_screen_5_fields($provider): array {
65 global $photonic_enable_popup;
66 $source = $this->get_source($provider);
67
68 $output = $source->get_screen_5();
69
70 $output['slideshow'] = $source->get_slideshow_options();
71 $output['square'] = $source->get_square_layout_options();
72 $output['random'] = $source->get_random_layout_options();
73
74 $output['L1'] = [
75 'count' => [
76 'desc' => esc_html__('Number of photos to show', 'photonic'),
77 'type' => 'text',
78 'hint' => esc_html__('Numeric values only. Leave blank for default.', 'photonic'),
79 ],
80 'more' => [
81 'desc' => esc_html__('"More" button text', 'photonic'),
82 'type' => 'text',
83 'hint' => esc_html__('Will show a "More" button with the specified text if the number of photos is higher than the above entry. Leave blank to show no button', 'photonic'),
84 ],
85 'show_gallery' => [
86 'desc' => esc_html__('"Show Gallery" button text', 'photonic'),
87 'type' => 'text',
88 'hint' => esc_html__('Will show a "Show Gallery" button with the specified text. This will show a button instead of the gallery when the page loads, saving time on the load. Users can click on this button to see the gallery. Leave blank to show no button', 'photonic'),
89 ],
90 ];
91 $output['L2'] = [
92 'count' => [
93 'desc' => esc_html__('Number of albums to show', 'photonic'),
94 'type' => 'text',
95 'hint' => esc_html__('Numeric values only. Leave blank for default.', 'photonic'),
96 ],
97 'more' => [
98 'desc' => esc_html__('"More" button text', 'photonic'),
99 'type' => 'text',
100 'hint' => esc_html__('Will show a "More" button with the specified text if the number of albums is higher than the above entry. Leave blank to show no button', 'photonic'),
101 ],
102 'popup_type' => [
103 'type' => 'field_list',
104 'list_type' => 'sequence',
105 'list' => [
106 'popup' => [
107 'desc' => esc_html__('Show photos in an overlaid popup panel upon clicking on an album / photoset / gallery', 'photonic'),
108 'type' => 'select',
109 'options' => [
110 '' => esc_html__('Default from settings', 'photonic') . ' - ' . ($photonic_enable_popup ?: esc_html__('No overlay', 'photonic')),
111 'hide' => esc_html__('No overlay - start showing photos in a lightbox', 'photonic'),
112 'show' => esc_html__('Show - show photos in a modal overlay first', 'photonic'),
113 'page' => esc_html__('Page - Show photos in a separate page', 'photonic'),
114 ],
115 'std' => '',
116 'hint' => sprintf(
117 esc_html__('Default settings under %4$s. Setting this to "No" would directly start up a lightbox with photos. Setting this to "Show" would show an overlaid panel that has the photos. Setting this to "Page" will take you to a separate page defined under %3$s. See %1$sdocumentation%2$s.', 'photonic'),
118 '<a href="https://aquoid.com/plugins/photonic/layouts/#nested" target="_blank">',
119 '</a>',
120 '<em>Photonic &rarr; Settings &rarr; Generic Options &rarr; Photo Template</em>',
121 '<em>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</em>'
122 ),
123 ],
124 'photo_count' => [
125 'desc' => esc_html__('Number of photos to show in overlaid popup / separate gallery page', 'photonic'),
126 'type' => 'text',
127 'hint' => esc_html__('Numeric values only. Leave blank for default.', 'photonic'),
128 'conditions' => ['popup' => ['show', 'page']],
129 ],
130 'photo_more' => [
131 'desc' => esc_html__('"More" button text in overlaid popup / separate gallery page', 'photonic'),
132 'type' => 'text',
133 'hint' => esc_html__('Will show a "More" button with the specified text if the number of photos in the overlaid popup is higher than the above entry. Leave blank to show no button', 'photonic'),
134 'conditions' => ['popup' => ['show', 'page']],
135 ],
136 'photo_layout' => [
137 'desc' => esc_html__('Layout of photos in separate gallery page', 'photonic'),
138 'type' => 'select',
139 'options' => Utilities::layout_options(true, esc_html__('Same as main gallery page', 'photonic')),
140 'conditions' => ['popup' => ['page']],
141 ]
142 ]
143 ],
144 'show_gallery' => [
145 'desc' => esc_html__('"Show Gallery" button text', 'photonic'),
146 'type' => 'text',
147 'hint' => esc_html__('Will show a "Show Gallery" button with the specified text. This will show a button instead of the gallery when the page loads, saving time on the load. Users can click on this button to see the gallery. Leave blank to show no button', 'photonic'),
148 ],
149 ];
150 $output['L3'] = [
151 'show_gallery' => [
152 'desc' => esc_html__('"Show Gallery" button text', 'photonic'),
153 'type' => 'text',
154 'hint' => esc_html__('Will show a "Show Gallery" button with the specified text. This will show a button instead of the gallery when the page loads, saving time on the load. Users can click on this button to see the gallery. Leave blank to show no button', 'photonic'),
155 ],
156 ];
157
158 $output['circle'] = $output['square'];
159 $output['masonry'] = $output['random'];
160 $output['masonry']['columns'] = $source->get_column_options();
161 $output['masonry-horizontal'] = $output['masonry'];
162 $output['mosaic'] = $output['random'];
163 unset($output['random']['title_position']['options']['below']);
164 unset($output['mosaic']['title_position']['options']['below']);
165 $output['L3']['popup_type'] = $output['L2']['popup_type'];
166
167 return $output;
168 }
169
170 /**
171 * @param $provider
172 * @return Source
173 */
174 public function get_source($provider): Source {
175 require_once $this->paths[$provider];
176 if ('flickr' === $provider) {
177 $source = Flickr::get_instance();
178 }
179 elseif ('smugmug' === $provider) {
180 $source = SmugMug::get_instance();
181 }
182 elseif ('google' === $provider) {
183 $source = Google_Photos::get_instance();
184 }
185 elseif ('zenfolio' === $provider) {
186 $source = Zenfolio::get_instance();
187 }
188 elseif ('instagram' === $provider) {
189 $source = Instagram::get_instance();
190 }
191 else {
192 $source = WP::get_instance();
193 }
194 return $source;
195 }
196 }
197