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