PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 2.41
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v2.41
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 / Options / SmugMug.php

SmugMug.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 2.41, at Options/SmugMug.php

359 lines 14.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Photonic_Plugin\Options;
3 use Photonic_Plugin\Core\Photonic;
4 use Photonic_Plugin\Core\Utilities;
5
6 class SmugMug extends Option_Tab {
7 private static $instance;
8
9 private function __construct() {
10 $this->options = [
11 ['name' => "How To",
12 'desc' => "Control generic settings for the plugin",
13 'category' => 'smug-how-to',
14 'buttons' => 'no-buttons',
15 'type' => 'section',],
16
17 ['name' => "Creating a gallery",
18 'desc' => "To create a gallery with SmugMug content you can use either a <strong><em>Gutenberg Block</em></strong>
19 or the <em>Add / Edit Photonic Gallery</em> button in the <strong><em>Classic Editor</em></strong>:<br/><br/>
20 <img src='".PHOTONIC_URL."Options/screenshots/SmugMug-1.png' style='max-width: 600px;' alt='Wizard'/>",
21 'grouping' => 'smug-how-to',
22 'type' => 'blurb',],
23
24 ['name' => "SmugMug settings",
25 'desc' => "Control settings for SmugMug",
26 'category' => 'smug-settings',
27 'type' => 'section',],
28
29 ['name' => "SmugMug API Key",
30 'desc' => "<strong>A SmugMug API key is not required unless you want to show private albums using authentication.</strong><br/>
31 To make use of the SmugMug authentication you have to use your <a href='https://api.smugmug.com/api/developer/apply'>SmugMug API Key</a>.<br/>
32 See <a href='https://aquoid.com/plugins/photonic/smugmug/#api-key'>here</a> for help.",
33 'id' => "smug_api_key",
34 'grouping' => 'smug-settings',
35 'type' => 'text'
36 ],
37
38 ['name' => "SmugMug API Secret",
39 'desc' => "You have to enter the Secret provided by SmugMug after you have registered your application.",
40 'id' => "smug_api_secret",
41 'grouping' => 'smug-settings',
42 'type' => 'text'
43 ],
44
45 ['name' => "Access Token (for authentication)",
46 'desc' => "To get your token go to <em>Photonic &rarr; Authentication &rarr; SmugMug</em>, and authenticate. Save the token you get here. <br/>If you have set
47 up a token, your users can see protected SmugMug photos without a SmugMug account. See <a href='https://aquoid.com/plugins/photonic/authentication/'>here</a> for more.",
48 'id' => "smug_access_token",
49 'grouping' => 'smug-settings',
50 'type' => 'text'
51 ],
52
53 ['name' => "Access Token Secret (for authentication)",
54 'desc' => "To get your token secret go to <em>Photonic &rarr; Authentication &rarr; SmugMug</em>, and authenticate. Save the token secret you get here. Your token secret works with the token set in the prvious option. See <a href='https://aquoid.com/plugins/photonic/authentication/'>here</a> for more.",
55 'id' => "smug_token_secret",
56 'grouping' => 'smug-settings',
57 'type' => 'text'
58 ],
59
60 ['name' => 'Default user',
61 'desc' => 'If no user is specified in the shortcode this one will be used. This is the username from https://<span style="text-decoration: underline">username</span>.smugmug.com/',
62 'id' => 'smug_default_user',
63 'grouping' => 'smug-settings',
64 'type' => 'text'
65 ],
66
67 ['name' => 'Media to show',
68 'desc' => 'You can choose to include photos as well as videos in your output. This can be overridden by the <code>media</code> parameter in the shortcode:',
69 'id' => "smug_media",
70 'grouping' => 'smug-settings',
71 'type' => 'select',
72 'options' => Utilities::media_options()
73 ],
74
75 ['name' => "Thumbnail size",
76 'desc' => "Pick a standard size provided by SmugMug for your thumbnails:",
77 'id' => "smug_thumb_size",
78 'grouping' => 'smug-settings',
79 'type' => 'select',
80 'options' => ["Tiny" => "Tiny", "Thumb" => "Thumb", "Small" => "Small"]
81 ],
82
83 ['name' => "Main image size",
84 'desc' => "When you click on a thumbnail this size will be displayed if you are using a slideshow. If you are not using a slideshow you will be taken to the SmugMug page:",
85 'id' => "smug_main_size",
86 'grouping' => 'smug-settings',
87 'type' => 'select',
88 'options' => [
89 '4K' => '4K (not always available)',
90 '5K' => '5K (not always available)',
91 "Medium" => "Medium",
92 "Original" => "Original (not always available)",
93 "Large" => "Large",
94 'Largest' => 'Largest',
95 "XLarge" => "XLarge (not always available)",
96 "X2Large" => "X2Large (not always available)",
97 "X3Large" => "X3Large (not always available)",
98 "X4Large" => "X3Large (not always available)",
99 "X5Large" => "X3Large (not always available)",
100 ]
101 ],
102
103 ['name' => "Tile image size",
104 'desc' => "<strong>This is applicable only if you are using the random tiled gallery, masonry or mosaic layouts.</strong> This size will be used as the image for the tiles. Picking a size smaller than the Main image size above will save bandwidth if your users <strong>don't click</strong> on individual images. Conversely, leaving this the same as the Main image size will save bandwidth if your users <strong>do click</strong> on individual images:",
105 'id' => "smug_tile_size",
106 'grouping' => 'smug-settings',
107 'type' => 'select',
108 'options' => [
109 "same" => "Same as Main image size",
110 "Small" => "Small",
111 '4K' => '4K (not always available)',
112 '5K' => '5K (not always available)',
113 "Medium" => "Medium",
114 "Original" => "Original (not always available)",
115 "Large" => "Large",
116 'Largest' => 'Largest',
117 "XLarge" => "XLarge (not always available)",
118 "X2Large" => "X2Large (not always available)",
119 "X3Large" => "X3Large (not always available)",
120 "X4Large" => "X3Large (not always available)",
121 "X5Large" => "X3Large (not always available)",
122 ]
123 ],
124
125 ['name' => "Video size",
126 'desc' => "When you click on a thumbnail this size will be displayed if you are using a slideshow. If you are not using a slideshow you will be taken to the SmugMug page:",
127 'id' => "smug_video_size",
128 'grouping' => 'smug-settings',
129 'type' => 'select',
130 'options' => [
131 '110' => '110px along longest side',
132 '200' => '200px along longest side',
133 '320' => '320px along longest side',
134 '640' => '640px along longest side',
135 '1280' => '1280px along longest side',
136 '1920' => '1920px along longest side',
137 'Largest' => 'Largest',
138 ]
139 ],
140
141 ['name' => "Disable lightbox linking",
142 'desc' => "Check this to disable linking the album title and/or thumbnail, or the title in the lightbox to the SmugMug page for the album / photo.",
143 'id' => "smug_disable_title_link",
144 'grouping' => 'smug-settings',
145 'type' => 'checkbox'
146 ],
147
148 ['name' => "Show \"Buy\" link",
149 'desc' => "Click to show a link to purchase the photo. This shows up in a lightbox, enabled.",
150 'id' => "smug_show_buy_link",
151 'grouping' => 'smug-settings',
152 'type' => 'checkbox'
153 ],
154
155 ['name' => "Photo titles and captions",
156 'desc' => "What do you want to show as the photo title in the tooltip and lightbox?",
157 'id' => "smug_title_caption",
158 'grouping' => 'smug-settings',
159 'type' => 'select',
160 'options' => Utilities::title_caption_options()
161 ],
162
163 ['name' => "Album Thumbnails (with other Albums)",
164 'desc' => "Control settings for SmugMug Album thumbnails",
165 'category' => "smug-albums",
166 'type' => 'section',],
167
168 ['name' => "What is this section?",
169 'desc' => "Options in this section are in effect when you pick the following gallery creation options:<br/><br/>
170 <img src='".PHOTONIC_URL."Options/screenshots/SmugMug-2.png' style='max-width: 600px;' alt='Albums'/><br/><br/>
171 If you are using the shortcode, the settings kick in for <code>[gallery type='smugmug' nick_name='abc']</code> or
172 <code>[gallery type='smugmug' nick_name='abc' view='albums']</code> or <code>[gallery type='smugmug' nick_name='abc' view='tree']</code>.
173 They are used to control the Album's thumbnail display",
174 'grouping' => "smug-albums",
175 'type' => 'blurb',],
176
177 ['name' => "Album Title Display",
178 'desc' => "How do you want the title of the Album?",
179 'id' => "smug_albums_album_title_display",
180 'grouping' => "smug-albums",
181 'type' => 'radio',
182 'options' => $this->title_styles(),
183 ],
184
185 ['name' => "Hide Photo Count in Title Display",
186 'desc' => "This will hide the number of photos in your Album's title.",
187 'id' => "smug_hide_albums_album_photos_count_display",
188 'grouping' => "smug-albums",
189 'type' => 'checkbox'
190 ],
191
192 ['name' => "Hide thumbnails for Password-protected albums",
193 'desc' => "This will hide the thumbnail of password-protected albums.",
194 'id' => "smug_hide_password_protected_thumbnail",
195 'grouping' => "smug-albums",
196 'type' => 'checkbox'
197 ],
198
199 ['name' => 'Album sort order',
200 'desc' => 'What should the results be sorted by?',
201 'id' => 'smug_album_sort_order',
202 'grouping' => 'smug-albums',
203 'type' => 'select',
204 'options' => [
205 'Last Updated (Descending)' => 'Last Updated (Descending)',
206 'Last Updated (Ascending)' => 'Last Updated (Ascending)',
207 'Date Added (Descending)' => 'Date Added (Descending)',
208 'Date Added (Ascending)' => 'Date Added (Ascending)',
209 ]
210 ],
211
212 ['name' => "Constrain Albums Per Row",
213 'desc' => "How do you want the control the number of album thumbnails per row? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.",
214 'id' => "smug_albums_album_per_row_constraint",
215 'grouping' => "smug-albums",
216 'type' => 'select',
217 'options' => ["padding" => "Fix the padding around the thumbnails",
218 "count" => "Fix the number of thumbnails per row",
219 ]
220 ],
221
222 ['name' => "Constrain by padding",
223 'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by",
224 'id' => "smug_albums_album_constrain_by_padding",
225 'grouping' => "smug-albums",
226 'type' => 'text',
227 'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."
228 ],
229
230 ['name' => "Constrain by number of thumbnails",
231 'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails",
232 'id' => "smug_albums_album_constrain_by_count",
233 'grouping' => "smug-albums",
234 'type' => 'select',
235 'options' => $this->selection_range(1, 25)
236 ],
237
238 ['name' => "Photos (Main Page)",
239 'desc' => "Control settings for SmugMug Photos when displayed in your page",
240 'category' => "smug-photos",
241 'type' => 'section',],
242
243 ['name' => "What is this section?",
244 'desc' => "Options in this section are in effect when you pick the following gallery creation options:<br/><br/>
245 <img src='".PHOTONIC_URL."Options/screenshots/SmugMug-3.png' style='max-width: 600px;' alt='Photos'/><br/><br/>
246 If you are using the shortcode, the settings kick in for <code>[gallery type='smugmug' nick_name='abc' view='album' album='pqr']</code>
247 or <code>[gallery type='smugmug' nick_name='abc' view='images' album='pqr']</code>. In other words, the photos are printed directly on the page.",
248 'grouping' => "smug-photos",
249 'type' => 'blurb',],
250
251 ['name' => "Hide Album Thumbnail",
252 'desc' => "This will hide the thumbnail for your SmugMug Album.",
253 'id' => "smug_hide_album_thumbnail",
254 'grouping' => "smug-photos",
255 'type' => 'checkbox'
256 ],
257
258 ['name' => "Hide Album Title",
259 'desc' => "This will hide the title for your SmugMug Album.",
260 'id' => "smug_hide_album_title",
261 'grouping' => "smug-photos",
262 'type' => 'checkbox'
263 ],
264
265 ['name' => "Hide Number of Photos",
266 'desc' => "This will hide the number of photos in your SmugMug Album.",
267 'id' => "smug_hide_album_photo_count",
268 'grouping' => "smug-photos",
269 'type' => 'checkbox'
270 ],
271
272 ['name' => "Photo Title Display",
273 'desc' => "How do you want the title of the photos?",
274 'id' => "smug_photo_title_display",
275 'grouping' => "smug-photos",
276 'type' => 'radio',
277 'options' => $this->title_styles(),
278 ],
279
280 ['name' => "Constrain Photos Per Row",
281 'desc' => "How do you want the control the number of photo thumbnails per row by default? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.",
282 'id' => "smug_photos_per_row_constraint",
283 'grouping' => "smug-photos",
284 'type' => 'select',
285 'options' => ["padding" => "Fix the padding around the thumbnails",
286 "count" => "Fix the number of thumbnails per row",
287 ]
288 ],
289
290 ['name' => "Constrain by padding",
291 'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by",
292 'id' => "smug_photos_constrain_by_padding",
293 'grouping' => "smug-photos",
294 'type' => 'text',
295 'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."
296 ],
297
298 ['name' => "Constrain by number of thumbnails",
299 'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails",
300 'id' => "smug_photos_constrain_by_count",
301 'grouping' => "smug-photos",
302 'type' => 'select',
303 'options' => $this->selection_range(1, 25)
304 ],
305
306 ['name' => "Photos (Popup Panel)",
307 'desc' => "Control settings for SmugMug Photos when displayed in a popup",
308 'category' => "smug-photos-pop",
309 'type' => 'section',],
310
311 ['name' => "What is this section?",
312 'desc' => "Options in this section are in effect when you use the shortcode format <code>[gallery type='smugmug' nick_name='abc' view='albums']</code>, and you click on an album thumbnail to open its photos in an overlaid panel.",
313 'grouping' => "smug-photos-pop",
314 'type' => 'blurb',],
315
316 ['name' => "Photo Title Display",
317 'desc' => "How do you want the title of the photos?",
318 'id' => "smug_photo_pop_title_display",
319 'grouping' => "smug-photos-pop",
320 'type' => 'radio',
321 'options' => $this->title_styles(),
322 ],
323
324 ['name' => "Constrain Photos Per Row",
325 'desc' => "How do you want the control the number of photo thumbnails per row by default? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.",
326 'id' => "smug_photos_pop_per_row_constraint",
327 'grouping' => "smug-photos-pop",
328 'type' => 'select',
329 'options' => ["padding" => "Fix the padding around the thumbnails",
330 "count" => "Fix the number of thumbnails per row",
331 ]
332 ],
333
334 ['name' => "Constrain by padding",
335 'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by",
336 'id' => "smug_photos_pop_constrain_by_padding",
337 'grouping' => "smug-photos-pop",
338 'type' => 'text',
339 'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."
340 ],
341
342 ['name' => "Constrain by number of thumbnails",
343 'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails",
344 'id' => "smug_photos_pop_constrain_by_count",
345 'grouping' => "smug-photos-pop",
346 'type' => 'select',
347 'options' => $this->selection_range(1, 25)
348 ],
349 ];
350 }
351
352 public static function get_instance() {
353 if (self::$instance == null) {
354 self::$instance = new SmugMug();
355 }
356 return self::$instance;
357 }
358 }
359