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
← All changes | Admin/Wizard/Screen_Fields.php +64 -53 2.41 → 3.37 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 namespace Photonic_Plugin\Admin\Wizard;
3 4
4 5 use Photonic_Plugin\Core\Utilities;
5 6
@@ -14,27 +15,29 @@
14 15 *
15 16 * @since 2.00
16 17 */
17 18 class Screen_Fields {
18 - var $layout_options;
19 - private $paths;
20 - function __construct() {
21 - require_once('Source.php');
19 + public array $layout_options;
20 + private array $paths;
21 +
22 + public function __construct() {
23 + require_once 'Source.php';
22 24 $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',
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',
29 31 ];
30 32 $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'),
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'),
37 40 ];
38 41 }
39 42
40 43 /**
@@ -39,27 +42,28 @@
39 42
40 43 /**
41 44 * @return array
42 45 */
43 - public function get_layout_options() {
46 + public function get_layout_options(): array {
44 47 return $this->layout_options;
45 48 }
46 49
47 50 /**
48 51 * @param $provider
49 - * @return array|mixed
52 + * @return array
50 53 */
51 - public function get_screen_2_fields($provider){
54 + public function get_screen_2_fields($provider): array {
52 55 $source = $this->get_source($provider);
53 56 return $source->get_screen_2();
54 57 }
55 58
56 - public function get_screen_3_fields($provider){
59 + public function get_screen_3_fields($provider): array {
57 60 $source = $this->get_source($provider);
58 61 return $source->get_screen_3();
59 62 }
60 63
61 - public function get_screen_5_fields($provider){
64 + public function get_screen_5_fields($provider): array {
65 + global $photonic_enable_popup;
62 66 $source = $this->get_source($provider);
63 67
64 68 $output = $source->get_screen_5();
65 69
@@ -67,14 +71,14 @@
67 71 $output['square'] = $source->get_square_layout_options();
68 72 $output['random'] = $source->get_random_layout_options();
69 73
70 74 $output['L1'] = [
71 - 'count' => [
75 + 'count' => [
72 76 'desc' => esc_html__('Number of photos to show', 'photonic'),
73 77 'type' => 'text',
74 78 'hint' => esc_html__('Numeric values only. Leave blank for default.', 'photonic'),
75 79 ],
76 - 'more' => [
80 + 'more' => [
77 81 'desc' => esc_html__('"More" button text', 'photonic'),
78 82 'type' => 'text',
79 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'),
80 84 ],
@@ -84,50 +88,56 @@
84 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'),
85 89 ],
86 90 ];
87 91 $output['L2'] = [
88 - 'count' => [
92 + 'count' => [
89 93 'desc' => esc_html__('Number of albums to show', 'photonic'),
90 94 'type' => 'text',
91 95 'hint' => esc_html__('Numeric values only. Leave blank for default.', 'photonic'),
92 96 ],
93 - 'more' => [
97 + 'more' => [
94 98 'desc' => esc_html__('"More" button text', 'photonic'),
95 99 'type' => 'text',
96 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'),
97 101 ],
98 - 'popup_type' => [
99 - 'type' => 'field_list',
102 + 'popup_type' => [
103 + 'type' => 'field_list',
100 104 '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 + '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',
105 109 'options' => [
106 - '' => '',
110 + '' => esc_html__('Default from settings', 'photonic') . ' - ' . ($photonic_enable_popup ?: esc_html__('No overlay', 'photonic')),
107 111 'hide' => esc_html__('No overlay - start showing photos in a lightbox', 'photonic'),
108 - 'show' => esc_html__('Yes - show photos in an overlay first', 'photonic'),
112 + 'show' => esc_html__('Show - show photos in a modal overlay first', 'photonic'),
109 113 'page' => esc_html__('Page - Show photos in a separate page', 'photonic'),
110 114 ],
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>'),
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 + ),
113 123 ],
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'),
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'),
118 128 'conditions' => ['popup' => ['show', 'page']],
119 129 ],
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'),
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'),
124 134 'conditions' => ['popup' => ['show', 'page']],
125 135 ],
126 136 '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')),
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')),
130 140 'conditions' => ['popup' => ['page']],
131 141 ]
132 142 ]
133 143 ],
@@ -147,8 +157,9 @@
147 157
148 158 $output['circle'] = $output['square'];
149 159 $output['masonry'] = $output['random'];
150 160 $output['masonry']['columns'] = $source->get_column_options();
161 + $output['masonry-horizontal'] = $output['masonry'];
151 162 $output['mosaic'] = $output['random'];
152 163 unset($output['random']['title_position']['options']['below']);
153 164 unset($output['mosaic']['title_position']['options']['below']);
154 165 $output['L3']['popup_type'] = $output['L2']['popup_type'];
@@ -159,23 +170,23 @@
159 170 /**
160 171 * @param $provider
161 172 * @return Source
162 173 */
163 - function get_source($provider) {
164 - require_once($this->paths[$provider]);
165 - if ($provider == 'flickr') {
174 + public function get_source($provider): Source {
175 + require_once $this->paths[$provider];
176 + if ('flickr' === $provider) {
166 177 $source = Flickr::get_instance();
167 178 }
168 - else if ($provider == 'smugmug') {
179 + elseif ('smugmug' === $provider) {
169 180 $source = SmugMug::get_instance();
170 181 }
171 - else if ($provider == 'google') {
182 + elseif ('google' === $provider) {
172 183 $source = Google_Photos::get_instance();
173 184 }
174 - else if ($provider == 'zenfolio') {
185 + elseif ('zenfolio' === $provider) {
175 186 $source = Zenfolio::get_instance();
176 187 }
177 - else if ($provider == 'instagram') {
188 + elseif ('instagram' === $provider) {
178 189 $source = Instagram::get_instance();
179 190 }
180 191 else {
181 192 $source = WP::get_instance();