PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.37
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.37
3.37 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 All 142 releases
photonic / Admin / Forms / Vanilla_Form.php

Vanilla_Form.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.37, at Admin/Forms/Vanilla_Form.php

1,270 lines 46.7 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\Forms;
4
5 use Photonic_Plugin\Core\Utilities;
6
7 /**
8 * Contains all fields required on the add / edit forms for the gallery.
9 */
10 class Vanilla_Form {
11 private array $fields;
12 private string $default_layout;
13 private static ?Vanilla_Form $instance = null;
14
15 private function __construct() {
16 global $photonic_thumbnail_style;
17 $this->default_layout = $photonic_thumbnail_style ?? 'square';
18
19 $this->fields = [];
20 $this->fields['default'] = $this->get_wp_fields();
21 $this->fields['flickr'] = $this->get_flickr_fields();
22 // $this->fields['google'] = $this->get_google_fields();
23 $this->fields['smugmug'] = $this->get_smugmug_fields();
24 $this->fields['zenfolio'] = $this->get_zenfolio_fields();
25 // $this->fields['instagram'] = $this->get_instagram_fields();
26 }
27
28 public static function get_instance(): Vanilla_Form {
29 if (null === self::$instance) {
30 self::$instance = new Vanilla_Form();
31 }
32 return self::$instance;
33 }
34
35 public function get_fields(): array {
36 return $this->fields;
37 }
38
39 private function get_wp_fields(): array {
40 global $photonic_wp_title_caption;
41 return [
42 'name' => esc_html__('WP Galleries', 'photonic'),
43 'fields' => [
44 [
45 'id' => 'id',
46 'name' => esc_html__('Gallery ID', 'photonic'),
47 'type' => 'text',
48 'req' => true,
49 ],
50
51 [
52 'id' => 'ids',
53 'name' => esc_html__('Image IDs', 'photonic'),
54 'type' => 'text',
55 'hint' => esc_html__('Comma-separated. You can specify this if there is no Gallery ID specified.', 'photonic'),
56 ],
57
58 [
59 'id' => 'style',
60 'name' => esc_html__('Display Style', 'photonic'),
61 'type' => 'select',
62 'options' => Utilities::layout_options(true),
63 'hint' => esc_html__('The first four options trigger a slideshow, the rest trigger a lightbox.', 'photonic'),
64 ],
65
66 [
67 'id' => 'count',
68 'name' => esc_html__('Number of photos to show', 'photonic'),
69 'type' => 'text',
70 ],
71
72 [
73 'id' => 'more',
74 'name' => esc_html__('"More" button text', 'photonic'),
75 'type' => 'text',
76 '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'),
77 ],
78
79 [
80 'id' => 'caption',
81 'name' => esc_html__('Photo title / caption', 'photonic'),
82 'type' => 'select',
83 'options' => Utilities::title_caption_options(),
84 'std' => $photonic_wp_title_caption,
85 'hint' => esc_html__('This will be used as the title for your photos.', 'photonic'),
86 ],
87
88 [
89 'id' => 'columns',
90 'name' => esc_html__('Number of columns', 'photonic'),
91 'type' => 'text',
92 'std' => 3,
93 ],
94
95 [
96 'id' => 'thumb_width',
97 'name' => esc_html__('Thumbnail width', 'photonic'),
98 'type' => 'text',
99 'std' => 75,
100 'hint' => esc_html__('In pixels', 'photonic')
101 ],
102
103 [
104 'id' => 'thumb_height',
105 'name' => esc_html__('Thumbnail height', 'photonic'),
106 'type' => 'text',
107 'std' => 75,
108 'hint' => esc_html__('In pixels', 'photonic')
109 ],
110
111 [
112 'id' => 'thumb_size',
113 'name' => esc_html__('Thumbnail size', 'photonic'),
114 'type' => 'raw',
115 'std' => self::get_image_sizes_selection('thumb_size', false),
116 'hint' => esc_html__('Sizes defined by your theme. Image picked here will be resized to the dimensions above.', 'photonic')
117 ],
118
119 [
120 'id' => 'main_size',
121 'name' => esc_html__('Main image size', 'photonic'),
122 'type' => 'raw',
123 'std' => self::get_image_sizes_selection('main_size', true),
124 'hint' => esc_html__('Sizes defined by your theme. Shown in a slideshow or lightbox. Avoid loading large sizes to reduce page loads.', 'photonic'),
125 ],
126
127 [
128 'id' => 'tile_size',
129 'name' => esc_html__('Tile image size', 'photonic'),
130 'type' => 'raw',
131 'std' => self::get_image_sizes_selection('tile_size', true),
132 'hint' => esc_html__('Sizes defined by your theme. Shown in mosaic or masonry or random justified grid galleries. Avoid loading large sizes to reduce page loads.', 'photonic'),
133 ],
134
135 [
136 'id' => 'fx',
137 'name' => esc_html__('Slideshow Effects', 'photonic'),
138 'type' => 'select',
139 'options' => [
140 'fade' => esc_html__('Fade', 'photonic'),
141 'slide' => esc_html__('Slide', 'photonic'),
142 ],
143 'std' => 'slide',
144 'hint' => esc_html__('Applies to slideshows only', 'photonic')
145 ],
146
147 [
148 'id' => 'controls',
149 'name' => esc_html__('Slideshow Controls', 'photonic'),
150 'type' => 'select',
151 'options' => [
152 'hide' => esc_html__('Hide', 'photonic'),
153 'show' => esc_html__('Show', 'photonic'),
154 ],
155 'hint' => esc_html__('Shows Previous and Next buttons on the slideshow.', 'photonic'),
156 ],
157
158 [
159 'id' => 'timeout',
160 'name' => esc_html__('Time between slides in ms', 'photonic'),
161 'type' => 'text',
162 'std' => 4000,
163 'hint' => esc_html__('Applies to slideshows only', 'photonic')
164 ],
165
166 [
167 'id' => 'speed',
168 'name' => esc_html__('Time for each transition in ms', 'photonic'),
169 'type' => 'text',
170 'std' => 1000,
171 'hint' => esc_html__('Applies to slideshows only', 'photonic')
172 ],
173 ],
174 ];
175 }
176
177 private function get_flickr_fields(): array {
178 global $photonic_flickr_title_caption, $photonic_flickr_thumb_size, $photonic_flickr_main_size, $photonic_flickr_media;
179 return [
180 'name' => esc_html__('Flickr', 'photonic'),
181 'prelude' => sprintf(
182 esc_html__('You have to define your Flickr API Key under %10$s.%1$s Documentation: %3$sOverall%2$s | %4$sPhotos%2$s | %5$sSingle Photos%2$s | %6$sAlbums (Photosets)%2$s| %7$sGalleries%2$s | %8$sCollections%2$s | %9$sAuthentication%2$s', 'photonic'),
183 '<br/>',
184 '</a>',
185 '<a href="https://aquoid.com/plugins/photonic/flickr/" target="_blank">',
186 '<a href="https://aquoid.com/plugins/photonic/flickr/flickr-photos/" target="_blank">',
187 '<a href="https://aquoid.com/plugins/photonic/flickr/flickr-photo/" target="_blank">',
188 '<a href="https://aquoid.com/plugins/photonic/flickr/flickr-photosets/" target="_blank">',
189 '<a href="https://aquoid.com/plugins/photonic/flickr/flickr-galleries/" target="_blank">',
190 '<a href="https://aquoid.com/plugins/photonic/flickr/flickr-collections/" target="_blank">',
191 '<a href="https://aquoid.com/plugins/photonic/flickr/flickr-authentication/" target="_blank">',
192 '<strong>Photonic &rarr; Settings &rarr; Flickr &rarr; Flickr Settings</strong>'
193 ),
194 'fields' => [
195 [
196 'id' => 'user_id',
197 'name' => esc_html__('User ID', 'photonic'),
198 'type' => 'text',
199 'req' => true,
200 'hint' => sprintf(esc_html__('Find your user ID from %s.', 'photonic'), '<strong>Photonic &rarr; Helpers</strong>')
201 ],
202
203 [
204 'id' => 'view',
205 'name' => esc_html__('Display', 'photonic'),
206 'type' => 'select',
207 'options' => [
208 'photos' => esc_html__('Photos', 'photonic'),
209 'photosets' => esc_html__('Photosets', 'photonic'),
210 'galleries' => esc_html__('Galleries', 'photonic'),
211 'collections' => esc_html__('Collections', 'photonic'),
212 'photo' => esc_html__('Single Photo', 'photonic'),
213 ],
214 'req' => true,
215 ],
216
217 [
218 'id' => 'photoset_id',
219 'name' => esc_html__('Album ID (Photoset ID)', 'photonic'),
220 'type' => 'text',
221 'hint' => esc_html__('Will show a single photoset if "Display" is set to "Photosets"', 'photonic')
222 ],
223
224 [
225 'id' => 'gallery_id',
226 'name' => esc_html__('Gallery ID', 'photonic'),
227 'type' => 'text',
228 'hint' => esc_html__('Will show a single gallery if "Display" is set to "Galleries"', 'photonic')
229 ],
230
231 [
232 'id' => 'collection_id',
233 'name' => esc_html__('Collection ID', 'photonic'),
234 'type' => 'text',
235 'hint' => esc_html__('Will show contents of a single collection if "Display" is set to "Collections"', 'photonic')
236 ],
237
238 [
239 'id' => 'photo_id',
240 'name' => esc_html__('Photo ID', 'photonic'),
241 'type' => 'text',
242 'hint' => esc_html__('Will show a single photo if "Display" is set to "Single Photo"', 'photonic')
243 ],
244
245 [
246 'id' => 'filter',
247 'name' => esc_html__('Filter', 'photonic'),
248 'type' => 'text',
249 'hint' => esc_html__('If "Display" is "Photosets" or "Galleries" or "Collections" and you provide a comma-separated list of values here, these entities will be included / excluded based on the next option. Useful if you want to display a single thumbnail for a single photoset / gallery, ignored if Photoset, Gallery or Collection ID is provided', 'photonic')
250 ],
251
252 [
253 'id' => 'filter_type',
254 'name' => esc_html__('Filter Type', 'photonic'),
255 'type' => 'select',
256 'options' => [
257 '' => '',
258 'include' => esc_html__('Include above list in results', 'photonic'),
259 'exclude' => esc_html__('Exclude above list from results', 'photonic'),
260 ],
261 ],
262
263 [
264 'id' => 'media',
265 'name' => esc_html__('Media to Show', 'photonic'),
266 'type' => 'select',
267 'options' => Utilities::media_options(),
268 'std' => $photonic_flickr_media,
269 ],
270
271 [
272 'id' => 'columns',
273 'name' => esc_html__('Number of columns', 'photonic'),
274 'type' => 'text',
275 ],
276
277 [
278 'id' => 'tags',
279 'name' => esc_html__('Tags', 'photonic'),
280 'type' => 'text',
281 'hint' => esc_html__('Comma-separated list of tags', 'photonic')
282 ],
283
284 [
285 'id' => 'tag_mode',
286 'name' => esc_html__('Tag mode', 'photonic'),
287 'type' => 'select',
288 'options' => [
289 'any' => esc_html__('Any tag', 'photonic'),
290 'all' => esc_html__('All tags', 'photonic'),
291 ],
292 ],
293
294 [
295 'id' => 'text',
296 'name' => esc_html__('With text', 'photonic'),
297 'type' => 'text',
298 ],
299
300 [
301 'id' => 'sort',
302 'name' => esc_html__('Sort by', 'photonic'),
303 'type' => 'select',
304 'options' => [
305 'date-posted-desc' => esc_html__('Date posted, descending', 'photonic'),
306 'date-posted-asc' => esc_html__('Date posted, ascending', 'photonic'),
307 'date-taken-asc' => esc_html__('Date taken, ascending', 'photonic'),
308 'date-taken-desc' => esc_html__('Date taken, descending', 'photonic'),
309 'interestingness-desc' => esc_html__('Interestingness, descending', 'photonic'),
310 'interestingness-asc' => esc_html__('Interestingness, ascending', 'photonic'),
311 'relevance' => esc_html__('Relevance', 'photonic'),
312 ],
313 ],
314
315 [
316 'id' => 'group_id',
317 'name' => esc_html__('Group ID', 'photonic'),
318 'type' => 'text',
319 ],
320
321 [
322 'id' => 'count',
323 'name' => esc_html__('Number of photos / albums / galleries to show', 'photonic'),
324 'type' => 'text',
325 'hint' => esc_html__('Will show at the most 100 by default, 500 is the maximum', 'photonic'),
326 ],
327
328 [
329 'id' => 'more',
330 'name' => esc_html__('"More" button text', 'photonic'),
331 'type' => 'text',
332 'hint' => esc_html__('Will show a "More" button with the specified text if the number of photos / albums / galleries is higher than the above entry. Leave blank to show no button', 'photonic'),
333 ],
334
335 [
336 'id' => 'photo_count',
337 'name' => esc_html__('Number of photos to show in overlaid popup', 'photonic'),
338 'type' => 'text',
339 'hint' => sprintf(esc_html__('Applicable for pagination if %1$s is selected. Leave blank to show maximum allowed photos.', 'photonic'), '<strong>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</strong>'),
340 ],
341
342 [
343 'id' => 'photo_more',
344 'name' => esc_html__('"More" button text in overlaid popup', 'photonic'),
345 'type' => 'text',
346 'hint' => sprintf(esc_html__('Applicable for pagination if %1$s is selected. 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'), '<strong>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</strong>'),
347 ],
348
349 [
350 'id' => 'privacy_filter',
351 'name' => esc_html__('Privacy filter', 'photonic'),
352 'type' => 'select',
353 'options' => [
354 '' => esc_html__('None', 'photonic'),
355 '1' => esc_html__('Public photos', 'photonic'),
356 '2' => esc_html__('Private photos visible to friends', 'photonic'),
357 '3' => esc_html__('Private photos visible to family', 'photonic'),
358 '4' => esc_html__('Private photos visible to friends & family', 'photonic'),
359 '5' => esc_html__('Completely private photos', 'photonic'),
360 ],
361 'hint' => esc_html__('Applicable only if Flickr private photos are turned on', 'photonic'),
362 ],
363
364 [
365 'id' => 'layout',
366 'name' => esc_html__('Layout', 'photonic'),
367 'type' => 'select',
368 'options' => Utilities::layout_options(),
369 'hint' => esc_html__('The first four options trigger a slideshow, the rest trigger a lightbox.', 'photonic'),
370 'std' => $this->default_layout,
371 ],
372
373 [
374 'id' => 'caption',
375 'name' => esc_html__('Photo title / caption', 'photonic'),
376 'type' => 'select',
377 'options' => Utilities::title_caption_options(),
378 'std' => $photonic_flickr_title_caption,
379 'hint' => esc_html__('This will be used as the title for your photos.', 'photonic'),
380 ],
381
382 [
383 'id' => 'thumb_size',
384 'name' => esc_html__('Thumbnail size', 'photonic'),
385 'type' => 'select',
386 'std' => $photonic_flickr_thumb_size,
387 "options" => [
388 's' => esc_html__('Small square, 75x75px', 'photonic'),
389 'q' => esc_html__('Large square, 150x150px', 'photonic'),
390 't' => esc_html__('Thumbnail, 100px on longest side', 'photonic'),
391 'm' => esc_html__('Small, 240px on longest side', 'photonic'),
392 'n' => esc_html__('Small, 320px on longest side', 'photonic'),
393 ],
394 'hint' => esc_html__('In pixels, only applicable to square and circular thumbnails', 'photonic')
395 ],
396
397 [
398 'id' => 'main_size',
399 'name' => esc_html__('Main image size', 'photonic'),
400 'type' => 'select',
401 'std' => $photonic_flickr_main_size,
402 'options' => [
403 'none' => esc_html__('Medium, 500px on the longest side', 'photonic'),
404 'z' => esc_html__('Medium, 640px on longest side', 'photonic'),
405 'c' => esc_html__('Medium, 800px on longest side', 'photonic'),
406 'b' => esc_html__('Large, 1024px on longest side', 'photonic'),
407 'h' => esc_html__('Large, 1600px on longest side', 'photonic'),
408 'k' => esc_html__('Large, 2048px on longest side', 'photonic'),
409 'o' => esc_html__('Original', 'photonic'),
410 ],
411 ],
412
413 [
414 'id' => 'collections_display',
415 'name' => esc_html__('Expand Collections', 'photonic'),
416 'type' => 'select',
417 'options' => [
418 '' => '',
419 'lazy' => esc_html__('Lazy loading', 'photonic'),
420 'expanded' => esc_html__('Expanded upfront', 'photonic'),
421 ],
422 'hint' => sprintf(esc_html__('The Collections API is slow, so, if you are displaying collections, pick %1$slazy loading%2$s if your collections have many albums / photosets.', 'photonic'), '<a href="https://aquoid.com/plugins/photonic/flickr/flickr-collections/">', '</a>'),
423 ],
424
425 [
426 'id' => 'fx',
427 'name' => esc_html__('Slideshow Effects', 'photonic'),
428 'type' => 'select',
429 'options' => [
430 '' => '',
431 'fade' => esc_html__('Fade', 'photonic'),
432 'slide' => esc_html__('Slide', 'photonic'),
433 ],
434 'std' => '',
435 'hint' => esc_html__('Applies to slideshows only', 'photonic')
436 ],
437
438 [
439 'id' => 'controls',
440 'name' => esc_html__('Slideshow Controls', 'photonic'),
441 'type' => 'select',
442 'options' => [
443 '' => '',
444 'hide' => esc_html__('Hide', 'photonic'),
445 'show' => esc_html__('Show', 'photonic'),
446 ],
447 'hint' => esc_html__('Shows Previous and Next buttons on the slideshow.', 'photonic'),
448 ],
449
450 [
451 'id' => 'timeout',
452 'name' => esc_html__('Time between slides in ms', 'photonic'),
453 'type' => 'text',
454 'std' => '',
455 'hint' => esc_html__('Applies to slideshows only', 'photonic')
456 ],
457
458 [
459 'id' => 'speed',
460 'name' => esc_html__('Time for each transition in ms', 'photonic'),
461 'type' => 'text',
462 'std' => '',
463 'hint' => esc_html__('Applies to slideshows only', 'photonic')
464 ],
465 ],
466 ];
467 }
468
469 private function get_google_fields(): array {
470 global $photonic_google_media;
471 return [
472 'name' => esc_html__('Google Photos', 'photonic'),
473 'prelude' => sprintf(
474 esc_html__('Documentation: %2$sOverall%1$s | %3$sPhotos%1$s | %4$sAlbums%1$s', 'photonic'),
475 '</a>',
476 '<a href="https://aquoid.com/plugins/photonic/google-photos/" target="_blank">',
477 '<a href="https://aquoid.com/plugins/photonic/google-photos/photos/" target="_blank">',
478 '<a href="https://aquoid.com/plugins/photonic/google-photos/albums/" target="_blank">'
479 ),
480 'fields' => [
481 [
482 'id' => 'view',
483 'name' => esc_html__('Display', 'photonic'),
484 'type' => 'select',
485 'options' => [
486 'albums' => esc_html__('Albums', 'photonic'),
487 'photos' => esc_html__('Photos', 'photonic'),
488 ],
489 'hint' => esc_html__('Pick "Albums" if you want to display a collection of albums. Pick "Photos" if you want to display photos from a single album or from your photo-stream.', 'photonic')
490 ],
491
492 [
493 'id' => 'album_id',
494 'name' => esc_html__('Album', 'photonic'),
495 'type' => 'text',
496 'hint' => sprintf(esc_html__('Applicable if "Display" is "Photos" and you want to show photos from an album. See %1$shere%2$s for more details.', 'photonic'), '<a href="https://aquoid.com/plugins/photonic/google-photos/albums/">', '</a>')
497 ],
498
499 [
500 'id' => 'access',
501 'name' => esc_html__('Displayed Access Levels', 'photonic'),
502 'type' => 'select',
503 'options' => [
504 '' => '',
505 'all' => esc_html__('Show all shared and not shared albums', 'photonic'),
506 'shared' => esc_html__('Only show shared albums', 'photonic'),
507 'not-shared' => esc_html__('Only show albums not shared', 'photonic'),
508 ],
509 'std' => '',
510 'hint' => sprintf(esc_html__('If "Display" is "Albums" you can decide to show shared or not-shared albums. See %1$shere%2$s for more details.', 'photonic'), '<a href="https://aquoid.com/plugins/photonic/google-photos/albums/">', '</a>')
511 ],
512
513 [
514 'id' => 'filter',
515 'name' => esc_html__('Album Filter', 'photonic'),
516 'type' => 'text',
517 'hint' => esc_html__('If "Display" is "Albums" and you provide a comma-separated list of values here, these entities will be included / excluded based on the next option. Useful if you want to display thumbnails for certain albums only, ignored if an album id is provided above', 'photonic')
518 ],
519
520 [
521 'id' => 'filter_type',
522 'name' => esc_html__('Album Filter Type', 'photonic'),
523 'type' => 'select',
524 'options' => [
525 '' => '',
526 'include' => esc_html__('Include above list in results', 'photonic'),
527 'exclude' => esc_html__('Exclude above list from results', 'photonic'),
528 ],
529 ],
530
531 [
532 'id' => 'date_filters',
533 'name' => esc_html__('Date Filters', 'photonic'),
534 'type' => 'text',
535 'hint' => sprintf(
536 esc_html__('Applicable only if "Display" is "Photos". You can provide a comma-separated list of dates and ranges in the format %1$sY/M/D%2$s or %1$sY/M/D-Y/M/D%2$s.', 'photonic'),
537 '<code>',
538 '</code>'
539 )
540 ],
541
542 [
543 'id' => 'content_filters',
544 'name' => esc_html__('Content Filters', 'photonic'),
545 'type' => 'text',
546 'hint' => sprintf(
547 esc_html__('Applicable only if "Display" is "Photos". You can provide a comma-separated list of categories from %s.', 'photonic'),
548 'NONE, LANDSCAPES, RECEIPTS, CITYSCAPES, LANDMARKS, SELFIES, PEOPLE, PETS, WEDDINGS, BIRTHDAYS, DOCUMENTS, TRAVEL, ANIMALS, FOOD, SPORT, NIGHT, PERFORMANCES, WHITEBOARDS, SCREENSHOTS, UTILITY'
549 )
550 ],
551
552 [
553 'id' => 'media',
554 'name' => esc_html__('Media to Show', 'photonic'),
555 'type' => 'select',
556 'options' => Utilities::media_options(),
557 'std' => $photonic_google_media,
558 ],
559
560 [
561 'id' => 'count',
562 'name' => esc_html__('Number of photos / albums to show', 'photonic'),
563 'type' => 'text',
564 ],
565
566 [
567 'id' => 'more',
568 'name' => esc_html__('"More" button text', 'photonic'),
569 'type' => 'text',
570 'hint' => esc_html__('Will show a "More" button with the specified text if the number of photos / albums is higher than the above entry. Leave blank to show no button', 'photonic'),
571 ],
572
573 [
574 'id' => 'photo_count',
575 'name' => esc_html__('Number of photos to show in overlaid popup', 'photonic'),
576 'type' => 'text',
577 'hint' => sprintf(esc_html__('Applicable for pagination if %s is selected. Leave blank to show maximum allowed photos.', 'photonic'), '<strong>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</strong>'),
578 ],
579
580 [
581 'id' => 'photo_more',
582 'name' => esc_html__('"More" button text in overlaid popup', 'photonic'),
583 'type' => 'text',
584 'hint' => sprintf(esc_html__('Applicable for pagination if %s is selected. 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'), '<strong>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</strong>'),
585 ],
586
587 [
588 'id' => 'layout',
589 'name' => esc_html__('Layout', 'photonic'),
590 'type' => 'select',
591 'options' => Utilities::layout_options(),
592 'hint' => esc_html__('The first four options trigger a slideshow, the rest trigger a lightbox.', 'photonic'),
593 'std' => $this->default_layout,
594 ],
595
596 [
597 'id' => 'thumb_size',
598 'name' => esc_html__('Thumbnail size', 'photonic'),
599 'type' => 'text',
600 'std' => 150,
601 'hint' => esc_html__('In pixels, only applicable to square and circular thumbnails. Permitted values: 32, 48, 64, 72, 104, 144, 150, 160.', 'photonic')
602 ],
603
604 [
605 'id' => 'crop_thumb',
606 'name' => esc_html__('Crop Thumbnail', 'photonic'),
607 'type' => 'select',
608 'options' => [
609 'crop' => esc_html__('Crop the thumbnail', 'photonic'),
610 'no-crop' => esc_html__('Do not crop the thumbnail', 'photonic'),
611 ],
612 'std' => 'crop',
613 'hint' => esc_html__('Cropping the thumbnail presents you with a square thumbnail.', 'photonic')
614 ],
615
616 [
617 'id' => 'main_size',
618 'name' => esc_html__('Main image size', 'photonic'),
619 'type' => 'text',
620 'std' => 1600,
621 'hint' => esc_html__('Numeric values between 1 and 16383, both inclusive.', 'photonic')
622 ],
623
624 [
625 'id' => 'tile_size',
626 'name' => esc_html__('Tile image size', 'photonic'),
627 'type' => 'text',
628 'std' => 1600,
629 'hint' => esc_html__('Numeric values between 1 and 16383, both inclusive. Leave blank to use the "Main image size".', 'photonic')
630 ],
631
632 [
633 'id' => 'fx',
634 'name' => esc_html__('Slideshow Effects', 'photonic'),
635 'type' => 'select',
636 'options' => [
637 '' => '',
638 'fade' => esc_html__('Fade', 'photonic'),
639 'slide' => esc_html__('Slide', 'photonic'),
640 ],
641 'std' => '',
642 'hint' => esc_html__('Applies to slideshows only', 'photonic')
643 ],
644
645 [
646 'id' => 'controls',
647 'name' => esc_html__('Slideshow Controls', 'photonic'),
648 'type' => 'select',
649 'options' => [
650 '' => '',
651 'hide' => esc_html__('Hide', 'photonic'),
652 'show' => esc_html__('Show', 'photonic'),
653 ],
654 'hint' => esc_html__('Shows Previous and Next buttons on the slideshow.', 'photonic'),
655 ],
656
657 [
658 'id' => 'timeout',
659 'name' => esc_html__('Time between slides in ms', 'photonic'),
660 'type' => 'text',
661 'std' => '',
662 'hint' => esc_html__('Applies to slideshows only', 'photonic')
663 ],
664
665 [
666 'id' => 'speed',
667 'name' => esc_html__('Time for each transition in ms', 'photonic'),
668 'type' => 'text',
669 'std' => '',
670 'hint' => esc_html__('Applies to slideshows only', 'photonic')
671 ],
672 ],
673 ];
674 }
675
676 private function get_smugmug_fields(): array {
677 global $photonic_smug_title_caption, $photonic_smug_thumb_size, $photonic_smug_main_size, $photonic_smug_media;
678 return [
679 'name' => esc_html__('SmugMug', 'photonic'),
680 'prelude' => sprintf(
681 esc_html__('You have to define your SmugMug API Key under %1$s.%2$s Documentation: %4$sOverall%3$s | %5$sPhotos%3$s | %6$sAlbums%3$s | %7$sFolders%3$s | %8$sUser Tree%3$s', 'photonic'),
682 '<strong>Photonic &rarr; Settings &rarr; SmugMug &rarr; SmugMug Settings</strong>',
683 '<br/>',
684 '</a>',
685 '<a href="https://aquoid.com/plugins/photonic/smugmug/" target="_blank">',
686 '<a href="https://aquoid.com/plugins/photonic/smugmug/smugmug-photos/" target="_blank">',
687 '<a href="https://aquoid.com/plugins/photonic/smugmug/smugmug-albums/" target="_blank">',
688 '<a href="https://aquoid.com/plugins/photonic/smugmug/folders/" target="_blank">',
689 '<a href="https://aquoid.com/plugins/photonic/smugmug/smugmug-tree/" target="_blank">'
690 ),
691 'fields' => [
692 [
693 'id' => 'view',
694 'name' => esc_html__('Display', 'photonic'),
695 'type' => 'select',
696 'options' => [
697 'tree' => esc_html__('Tree', 'photonic'),
698 'albums' => esc_html__('All albums', 'photonic'),
699 'album' => esc_html__('Single Album', 'photonic'),
700 'folder' => esc_html__('Single Folder', 'photonic'),
701 ],
702 'req' => true,
703 ],
704
705 [
706 'id' => 'nick_name',
707 'name' => esc_html__('Nickname', 'photonic'),
708 'type' => 'text',
709 'hint' => esc_html__('If your SmugMug URL is https://joe-sixpack.smugmug.com, this is "joe-sixpack". Required if the "Display" is "Tree" or "All albums".', 'photonic')
710 ],
711
712 [
713 'id' => 'site_password',
714 'name' => esc_html__('Site Password', 'photonic'),
715 'type' => 'text',
716 'hint' => esc_html__('Required if your entire SmugMug site is password-protected. See documentation link for "Albums" above.', 'photonic')
717 ],
718
719 [
720 'id' => 'album',
721 'name' => esc_html__('Album', 'photonic'),
722 'type' => 'text',
723 'hint' => sprintf(esc_html__('Required if you are showing "Single Album" above. To find this, go to %s on your dashboard and find the albums for your nickname.', 'photonic'), '<strong>Photonic &rarr; Helpers &rarr; SmugMug</strong>')
724 ],
725
726 [
727 'id' => 'filter',
728 'name' => esc_html__('Filter', 'photonic'),
729 'type' => 'text',
730 'hint' => esc_html__('If "Display" is "All albums" and you provide a comma-separated list of album keys here, these entities will be included / excluded based on the next option. Useful if you want to display thumbnails for certain albums only, ignored if an album is provided above', 'photonic')
731 ],
732
733 [
734 'id' => 'filter_type',
735 'name' => esc_html__('Filter Type', 'photonic'),
736 'type' => 'select',
737 'options' => [
738 '' => '',
739 'include' => esc_html__('Include above list in results', 'photonic'),
740 'exclude' => esc_html__('Exclude above list from results', 'photonic'),
741 ],
742 ],
743
744 [
745 'id' => 'text',
746 'name' => esc_html__('Photos with text', 'photonic'),
747 'type' => 'text',
748 'hint' => esc_html__('Will show photos with the specified text. Leave blank for no filter.', 'photonic')
749 ],
750
751 [
752 'id' => 'keywords',
753 'name' => esc_html__('Photos with keywords', 'photonic'),
754 'type' => 'text',
755 'hint' => esc_html__('Will show photos with the specified keywords. Leave blank for no filter.', 'photonic')
756 ],
757
758 [
759 'id' => 'media',
760 'name' => esc_html__('Media to Show', 'photonic'),
761 'type' => 'select',
762 'options' => Utilities::media_options(),
763 'std' => $photonic_smug_media,
764 ],
765
766 [
767 'id' => 'password',
768 'name' => esc_html__('Album Password', 'photonic'),
769 'type' => 'text',
770 'hint' => esc_html__('Required if you are showing "Single Album" above, and if your album is password-protected. See documentation link for "Photos" above.', 'photonic')
771 ],
772
773 [
774 'id' => 'album_sort_order',
775 'name' => esc_html__('Album sort order', 'photonic'),
776 'type' => 'select',
777 'options' => [
778 'Album Settings' => esc_html__('Album Settings', 'photonic'),
779 'Position' => esc_html__('Position', 'photonic'),
780 'Last Updated (Descending)' => esc_html__('Last Updated (Descending)', 'photonic'),
781 'Last Updated (Ascending)' => esc_html__('Last Updated (Ascending)', 'photonic'),
782 'Date Added (Descending)' => esc_html__('Date Added (Descending)', 'photonic'),
783 'Date Added (Ascending)' => esc_html__('Date Added (Ascending)', 'photonic'),
784 ],
785 'std' => 'Album Settings',
786 'hint' => esc_html__('If you are displaying multiple albums the results are sorted by this parameter', 'photonic'),
787 ],
788
789 [
790 'id' => 'folder',
791 'name' => esc_html__('Folder', 'photonic'),
792 'type' => 'text',
793 'hint' => sprintf(esc_html__('Required if you are showing "Single Folder" above. To find this, go to %s on your dashboard and find the folders for your nickname.', 'photonic'), '<strong>Photonic &rarr; Helpers &rarr; SmugMug</strong>')
794 ],
795
796 [
797 'id' => 'layout',
798 'name' => esc_html__('Layout', 'photonic'),
799 'type' => 'select',
800 'options' => Utilities::layout_options(),
801 'hint' => esc_html__('The first four options trigger a slideshow, the rest trigger a lightbox.', 'photonic'),
802 'std' => $this->default_layout,
803 ],
804
805 [
806 'id' => 'caption',
807 'name' => esc_html__('Photo title / caption', 'photonic'),
808 'type' => 'select',
809 'options' => Utilities::title_caption_options(),
810 'std' => $photonic_smug_title_caption,
811 'hint' => esc_html__('This will be used as the title for your photos.', 'photonic'),
812 ],
813
814 [
815 'id' => 'thumb_size',
816 'name' => esc_html__('Thumbnail size', 'photonic'),
817 'type' => 'select',
818 'std' => $photonic_smug_thumb_size,
819 "options" => [
820 'Tiny' => esc_html__('Tiny', 'photonic'),
821 'Thumb' => esc_html__('Thumb', 'photonic'),
822 'Small' => esc_html__('Small', 'photonic'),
823 ],
824 'hint' => esc_html__('In pixels, only applicable to square and circular thumbnails', 'photonic')
825 ],
826
827 [
828 'id' => 'main_size',
829 'name' => esc_html__('Main image size', 'photonic'),
830 'type' => 'select',
831 'std' => $photonic_smug_main_size,
832 'options' => [
833 '4K' => esc_html__('4K (not always available)', 'photonic'),
834 '5K' => esc_html__('5K (not always available)', 'photonic'),
835 'Medium' => esc_html__('Medium', 'photonic'),
836 'Original' => esc_html__('Original (not always available)', 'photonic'),
837 'Large' => esc_html__('Large', 'photonic'),
838 'Largest' => esc_html__('Largest available', 'photonic'),
839 'XLarge' => esc_html__('XLarge (not always available)', 'photonic'),
840 'X2Large' => esc_html__('X2Large (not always available)', 'photonic'),
841 'X3Large' => esc_html__('X3Large (not always available)', 'photonic'),
842 ],
843 ],
844
845 [
846 'id' => 'columns',
847 'name' => esc_html__('Number of columns', 'photonic'),
848 'type' => 'text',
849 ],
850
851 [
852 'id' => 'count',
853 'name' => esc_html__('Number of photos / albums to show', 'photonic'),
854 'type' => 'text',
855 ],
856
857 [
858 'id' => 'more',
859 'name' => esc_html__('"More" button text', 'photonic'),
860 'type' => 'text',
861 'hint' => esc_html__('Will show a "More" button with the specified text if the number of photos / albums is higher than the above entry. Leave blank to show no button', 'photonic'),
862 ],
863
864 [
865 'id' => 'photo_count',
866 'name' => esc_html__('Number of photos to show in overlaid popup', 'photonic'),
867 'type' => 'text',
868 'hint' => sprintf(esc_html__('Applicable for pagination if %s is selected. Leave blank to show maximum allowed photos.', 'photonic'), '<strong>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</strong>'),
869 ],
870
871 [
872 'id' => 'photo_more',
873 'name' => esc_html__('"More" button text in overlaid popup', 'photonic'),
874 'type' => 'text',
875 'hint' => sprintf(esc_html__('Applicable for pagination if %s is selected. 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'), '<strong>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</strong>'),
876 ],
877
878 [
879 'id' => 'fx',
880 'name' => esc_html__('Slideshow Effects', 'photonic'),
881 'type' => 'select',
882 'options' => [
883 '' => '',
884 'fade' => esc_html__('Fade', 'photonic'),
885 'slide' => esc_html__('Slide', 'photonic'),
886 ],
887 'std' => '',
888 'hint' => esc_html__('Applies to slideshows only', 'photonic')
889 ],
890
891 [
892 'id' => 'controls',
893 'name' => esc_html__('Slideshow Controls', 'photonic'),
894 'type' => 'select',
895 'options' => [
896 '' => '',
897 'hide' => esc_html__('Hide', 'photonic'),
898 'show' => esc_html__('Show', 'photonic'),
899 ],
900 'hint' => esc_html__('Shows Previous and Next buttons on the slideshow.', 'photonic'),
901 ],
902
903 [
904 'id' => 'timeout',
905 'name' => esc_html__('Time between slides in ms', 'photonic'),
906 'type' => 'text',
907 'std' => '',
908 'hint' => esc_html__('Applies to slideshows only', 'photonic')
909 ],
910
911 [
912 'id' => 'speed',
913 'name' => esc_html__('Time for each transition in ms', 'photonic'),
914 'type' => 'text',
915 'std' => '',
916 'hint' => esc_html__('Applies to slideshows only', 'photonic')
917 ],
918 ],
919 ];
920 }
921
922 private function get_zenfolio_fields(): array {
923 global $photonic_zenfolio_title_caption, $photonic_zenfolio_thumb_size, $photonic_zenfolio_main_size, $photonic_zenfolio_media;
924 return [
925 'name' => esc_html__('Zenfolio', 'photonic'),
926 'prelude' => sprintf(
927 esc_html__('Documentation: %2$sOverall%1$s | %3$sPhotos%1$s | %4$sPhotosets%1$s | %5$sGroups%1$s | %6$sGroup Hierarchy%1$s', 'photonic'),
928 '</a>',
929 '<a href="https://aquoid.com/plugins/photonic/zenfolio/" target="_blank">',
930 '<a href="https://aquoid.com/plugins/photonic/zenfolio/photos/" target="_blank">',
931 '<a href="https://aquoid.com/plugins/photonic/zenfolio/photosets/" target="_blank">',
932 '<a href="https://aquoid.com/plugins/photonic/zenfolio/groups/" target="_blank">',
933 '<a href="https://aquoid.com/plugins/photonic/zenfolio/group-hierarchy/" target="_blank">'
934 ),
935 'fields' => [
936 [
937 'id' => 'view',
938 'name' => esc_html__('Display', 'photonic'),
939 'type' => 'select',
940 'options' => [
941 'photos' => esc_html__('Photos', 'photonic'),
942 'photosets' => esc_html__('Photosets', 'photonic'),
943 'hierarchy' => esc_html__('Group Hierarchy', 'photonic'),
944 'group' => esc_html__('Group', 'photonic'),
945 ],
946 'req' => true,
947 ],
948
949 [
950 'id' => 'object_id',
951 'name' => esc_html__('Object ID', 'photonic'),
952 'type' => 'text',
953 'hint' => sprintf(esc_html__('Can be set if "Display" is %1$sPhotos%2$s, %1$sPhotosets%2$s or %1$sGroup%2$s.', 'photonic'), '<code>', '</code>'),
954 ],
955
956 [
957 'id' => 'text',
958 'name' => esc_html__('Search by text', 'photonic'),
959 'type' => 'text',
960 'hint' => sprintf(esc_html__('Can be set if "Display" is %1$sPhotos%2$s or %1$sPhotosets%2$s.', 'photonic'), '<code>', '</code>'),
961 ],
962
963 [
964 'id' => 'category_code',
965 'name' => esc_html__('Search by category code', 'photonic'),
966 'type' => 'text',
967 'hint' => sprintf(esc_html__('Can be set if "Display" is %1$sPhotos%2$s or %1$sPhotosets%2$s.', 'photonic'), '<code>', '</code>') . '<br/>' .
968 sprintf(esc_html__('See the list of categories from %s.', 'photonic'), '<strong>Photonic &rarr; Helpers</strong>'),
969 ],
970
971 [
972 'id' => 'sort_order',
973 'name' => esc_html__('Search results sort order', 'photonic'),
974 'type' => 'select',
975 'options' => [
976 '' => '',
977 'Date' => esc_html__('Date', 'photonic'),
978 'Popularity' => esc_html__('Popularity', 'photonic'),
979 'Rank' => esc_html__('Rank (for searching by text only)', 'photonic'),
980 ],
981 'hint' => sprintf(esc_html__('Can be set if "Display" is %1$sPhotos%2$s or %1$sPhotosets%2$s.', 'photonic'), '<code>', '</code>') . '<br/>' .
982 esc_html__('For search results only.', 'photonic'),
983 ],
984
985 [
986 'id' => 'photoset_type',
987 'name' => esc_html__('Photoset type', 'photonic'),
988 'type' => 'select',
989 'options' => [
990 '' => '',
991 'Gallery' => esc_html__('Gallery', 'photonic'),
992 'Collection' => esc_html__('Collection', 'photonic'),
993 ],
994 'hint' => esc_html__('Mandatory if Display = Photosets and no Object ID is specified.', 'photonic'),
995 ],
996
997 [
998 'id' => 'kind',
999 'name' => esc_html__('Display classification', 'photonic'),
1000 'type' => 'select',
1001 'options' => [
1002 '' => '',
1003 'popular' => esc_html__('Popular', 'photonic'),
1004 'recent' => esc_html__('Recent', 'photonic'),
1005 ],
1006 'hint' => sprintf(esc_html__('Mandatory if "Display" is %1$sPhotos%2$s or %1$sPhotosets%2$s, and none of the other criteria above is specified.', 'photonic'), '<code>', '</code>'),
1007 ],
1008
1009 [
1010 'id' => 'login_name',
1011 'name' => esc_html__('Login name', 'photonic'),
1012 'type' => 'text',
1013 'hint' => esc_html__('Mandatory if Display = Hierarchy', 'photonic'),
1014 ],
1015
1016 [
1017 'id' => 'media',
1018 'name' => esc_html__('Media to Show', 'photonic'),
1019 'type' => 'select',
1020 'options' => Utilities::media_options(),
1021 'std' => $photonic_zenfolio_media,
1022 ],
1023
1024 [
1025 'id' => 'layout',
1026 'name' => esc_html__('Layout', 'photonic'),
1027 'type' => 'select',
1028 'options' => Utilities::layout_options(),
1029 'hint' => esc_html__('The first four options trigger a slideshow, the rest trigger a lightbox.', 'photonic'),
1030 'std' => $this->default_layout,
1031 ],
1032
1033 [
1034 'id' => 'structure',
1035 'name' => esc_html__('Group / Hierarchy structure', 'photonic'),
1036 'type' => 'select',
1037 'options' => [
1038 '' => '',
1039 'flat' => esc_html__('All photosets shown in single level', 'photonic'),
1040 'nested' => esc_html__('Photosets shown nested within groups', 'photonic'),
1041 ],
1042 'hint' => esc_html__('Applicable if groups or hierarchies are being displayed.', 'photonic'),
1043 ],
1044
1045 [
1046 'id' => 'caption',
1047 'name' => esc_html__('Photo title / caption', 'photonic'),
1048 'type' => 'select',
1049 'options' => Utilities::title_caption_options(),
1050 'std' => $photonic_zenfolio_title_caption,
1051 'hint' => esc_html__('This will be used as the title for your photos.', 'photonic'),
1052 ],
1053
1054 [
1055 'id' => 'thumb_size',
1056 'name' => esc_html__('Thumbnail size', 'photonic'),
1057 'type' => 'select',
1058 'std' => $photonic_zenfolio_thumb_size,
1059 "options" => [
1060 "1" => esc_html__("Square thumbnail, 60 &times; 60px, cropped square", 'photonic'),
1061 "0" => esc_html__("Small thumbnail, upto 80 &times; 80px", 'photonic'),
1062 "10" => esc_html__("Medium thumbnail, upto 120 &times; 120px", 'photonic'),
1063 "11" => esc_html__("Large thumbnail, upto 120 &times; 120px", 'photonic'),
1064 "2" => esc_html__("Small image, upto 400 &times; 400px", 'photonic'),
1065 ],
1066 'hint' => esc_html__('In pixels, only applicable to square and circular thumbnails', 'photonic')
1067 ],
1068
1069 [
1070 'id' => 'main_size',
1071 'name' => esc_html__('Main image size', 'photonic'),
1072 'type' => 'select',
1073 'std' => $photonic_zenfolio_main_size,
1074 'options' => [
1075 '2' => esc_html__('Small image, upto 400 &times; 400px', 'photonic'),
1076 '3' => esc_html__('Medium image, upto 580 &times; 450px', 'photonic'),
1077 '4' => esc_html__('Large image, upto 800 &times; 630px', 'photonic'),
1078 '5' => esc_html__('X-Large image, upto 1100 &times; 850px', 'photonic'),
1079 '6' => esc_html__('XX-Large image, upto 1550 &times; 960px', 'photonic'),
1080 ],
1081 ],
1082
1083 [
1084 'id' => 'columns',
1085 'name' => esc_html__('Number of columns', 'photonic'),
1086 'type' => 'text',
1087 ],
1088
1089 [
1090 'id' => 'count',
1091 'name' => esc_html__('Number of photos to show', 'photonic'),
1092 'type' => 'text',
1093 ],
1094
1095 [
1096 'id' => 'more',
1097 'name' => esc_html__('"More" button text', 'photonic'),
1098 'type' => 'text',
1099 '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'),
1100 ],
1101
1102 [
1103 'id' => 'photo_count',
1104 'name' => esc_html__('Number of photos to show in overlaid popup', 'photonic'),
1105 'type' => 'text',
1106 'hint' => sprintf(esc_html__('Applicable for pagination if %s is selected. Leave blank to show maximum allowed photos.', 'photonic'), '<strong>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</strong>'),
1107 ],
1108
1109 [
1110 'id' => 'photo_more',
1111 'name' => esc_html__('"More" button text in overlaid popup', 'photonic'),
1112 'type' => 'text',
1113 'hint' => sprintf(esc_html__('Applicable for pagination if %s is selected. 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'), '<strong>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr; Enable Interim Popup for Album Thumbnails</strong>'),
1114 ],
1115
1116 [
1117 'id' => 'fx',
1118 'name' => esc_html__('Slideshow Effects', 'photonic'),
1119 'type' => 'select',
1120 'options' => [
1121 '' => '',
1122 'fade' => esc_html__('Fade', 'photonic'),
1123 'slide' => esc_html__('Slide', 'photonic'),
1124 ],
1125 'std' => '',
1126 'hint' => esc_html__('Applies to slideshows only', 'photonic')
1127 ],
1128
1129 [
1130 'id' => 'controls',
1131 'name' => esc_html__('Slideshow Controls', 'photonic'),
1132 'type' => 'select',
1133 'options' => [
1134 '' => '',
1135 'hide' => esc_html__('Hide', 'photonic'),
1136 'show' => esc_html__('Show', 'photonic'),
1137 ],
1138 'hint' => esc_html__('Shows Previous and Next buttons on the slideshow.', 'photonic'),
1139 ],
1140
1141 [
1142 'id' => 'timeout',
1143 'name' => esc_html__('Time between slides in ms', 'photonic'),
1144 'type' => 'text',
1145 'std' => '',
1146 'hint' => esc_html__('Applies to slideshows only', 'photonic')
1147 ],
1148
1149 [
1150 'id' => 'speed',
1151 'name' => esc_html__('Time for each transition in ms', 'photonic'),
1152 'type' => 'text',
1153 'std' => '',
1154 'hint' => esc_html__('Applies to slideshows only', 'photonic')
1155 ],
1156 ],
1157 ];
1158 }
1159
1160 private function get_instagram_fields(): array {
1161 global $photonic_instagram_media;
1162 return [
1163 'name' => esc_html__('Instagram', 'photonic'),
1164 'prelude' => sprintf(esc_html__('Documentation: %1$sInstagram%2$s', 'photonic'), '<a href="https://aquoid.com/plugins/photonic/instagram/" target="_blank">', '</a>'),
1165 'fields' => [
1166 [
1167 'id' => 'media_id',
1168 'name' => esc_html__('Media ID', 'photonic'),
1169 'type' => 'text',
1170 'hint' => sprintf(esc_html__('If your photo is at %1$shttps://instagram.com/p/ABcde5678fg/%2$s, your media id is %1$sABcde5678fg%2$s.', 'photonic'), '<code>', '</code>')
1171 ],
1172
1173 [
1174 'id' => 'carousel',
1175 'name' => esc_html__('Instagram Post ID', 'photonic'),
1176 'type' => 'text',
1177 'hint' => sprintf(esc_html__('If your post is at %1$shttps://instagram.com/p/ABcde5678fg/%2$s, your post id is %1$sABcde5678fg%2$s.', 'photonic'), '<code>', '</code>')
1178 ],
1179
1180 [
1181 'id' => 'layout',
1182 'name' => esc_html__('Layout', 'photonic'),
1183 'type' => 'select',
1184 'options' => Utilities::layout_options(),
1185 'hint' => esc_html__('The first four options trigger a slideshow, the rest trigger a lightbox.', 'photonic'),
1186 'std' => $this->default_layout,
1187 ],
1188
1189 [
1190 'id' => 'media',
1191 'name' => esc_html__('Media to Show', 'photonic'),
1192 'type' => 'select',
1193 'options' => Utilities::media_options(),
1194 'std' => $photonic_instagram_media,
1195 ],
1196
1197 [
1198 'id' => 'columns',
1199 'name' => esc_html__('Number of columns', 'photonic'),
1200 'type' => 'text',
1201 ],
1202
1203 [
1204 'id' => 'count',
1205 'name' => esc_html__('Number of photos to show', 'photonic'),
1206 'type' => 'text',
1207 ],
1208
1209 [
1210 'id' => 'more',
1211 'name' => esc_html__('"More" button text', 'photonic'),
1212 'type' => 'text',
1213 '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'),
1214 ],
1215
1216 [
1217 'id' => 'fx',
1218 'name' => esc_html__('Slideshow Effects', 'photonic'),
1219 'type' => 'select',
1220 'options' => [
1221 '' => '',
1222 'fade' => esc_html__('Fade', 'photonic'),
1223 'slide' => esc_html__('Slide', 'photonic'),
1224 ],
1225 'std' => '',
1226 'hint' => esc_html__('Applies to slideshows only', 'photonic')
1227 ],
1228
1229 [
1230 'id' => 'controls',
1231 'name' => esc_html__('Slideshow Controls', 'photonic'),
1232 'type' => 'select',
1233 'options' => [
1234 '' => '',
1235 'hide' => esc_html__('Hide', 'photonic'),
1236 'show' => esc_html__('Show', 'photonic'),
1237 ],
1238 'hint' => esc_html__('Shows Previous and Next buttons on the slideshow.', 'photonic'),
1239 ],
1240
1241 [
1242 'id' => 'timeout',
1243 'name' => esc_html__('Time between slides in ms', 'photonic'),
1244 'type' => 'text',
1245 'std' => '',
1246 'hint' => esc_html__('Applies to slideshows only', 'photonic')
1247 ],
1248
1249 [
1250 'id' => 'speed',
1251 'name' => esc_html__('Time for each transition in ms', 'photonic'),
1252 'type' => 'text',
1253 'std' => '',
1254 'hint' => esc_html__('Applies to slideshows only', 'photonic')
1255 ],
1256 ],
1257 ];
1258 }
1259
1260 public static function get_image_sizes_selection($element_name, $show_full = false): string {
1261 $image_sizes = Utilities::get_wp_image_sizes($show_full);
1262 $ret = "<select name='$element_name'>";
1263 foreach ($image_sizes as $size_name => $size_attrs) {
1264 $ret .= "<option value='$size_name'>$size_name ({$size_attrs['width']} &times; {$size_attrs['height']})</option>";
1265 }
1266 $ret .= '</select>';
1267 return $ret;
1268 }
1269 }
1270