PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 2.40
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v2.40
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 2.40, at Admin/Wizard/Screen_Fields.php

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