| 1 |
<?php |
| 2 |
namespace Photonic_Plugin\Options; |
| 3 |
use Photonic_Plugin\Core\Utilities; |
| 4 |
|
| 5 |
class Zenfolio extends Option_Tab { |
| 6 |
private static $instance; |
| 7 |
|
| 8 |
private function __construct() { |
| 9 |
$this->options = [ |
| 10 |
['name' => "Zenfolio Photo Settings", |
| 11 |
'desc' => "Control settings for Zenfolio", |
| 12 |
'category' => 'zenfolio-settings', |
| 13 |
'type' => 'section',], |
| 14 |
|
| 15 |
['name' => 'Default user', |
| 16 |
'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>.zenfolio.com/', |
| 17 |
'id' => 'zenfolio_default_user', |
| 18 |
'grouping' => 'zenfolio-settings', |
| 19 |
'type' => 'text' |
| 20 |
], |
| 21 |
|
| 22 |
['name' => 'Media to show', |
| 23 |
'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:', |
| 24 |
'id' => "zenfolio_media", |
| 25 |
'grouping' => "zenfolio-settings", |
| 26 |
'type' => 'select', |
| 27 |
'options' => Utilities::media_options() |
| 28 |
], |
| 29 |
|
| 30 |
['name' => "Disable lightbox linking", |
| 31 |
'desc' => "Check this to disable linking the photo title in the lightbox to the original photo page.", |
| 32 |
'id' => "zenfolio_disable_title_link", |
| 33 |
'grouping' => 'zenfolio-settings', |
| 34 |
'type' => 'checkbox' |
| 35 |
], |
| 36 |
|
| 37 |
['name' => "Constrain Photos Per Row", |
| 38 |
'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.", |
| 39 |
'id' => "zenfolio_photos_per_row_constraint", |
| 40 |
'grouping' => 'zenfolio-settings', |
| 41 |
'type' => 'select', |
| 42 |
'options' => ["padding" => "Fix the padding around the thumbnails", |
| 43 |
"count" => "Fix the number of thumbnails per row", |
| 44 |
] |
| 45 |
], |
| 46 |
|
| 47 |
['name' => "Constrain by padding", |
| 48 |
'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by", |
| 49 |
'id' => "zenfolio_photos_constrain_by_padding", |
| 50 |
'grouping' => 'zenfolio-settings', |
| 51 |
'type' => 'text', |
| 52 |
'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored." |
| 53 |
], |
| 54 |
|
| 55 |
['name' => "Constrain by number of thumbnails", |
| 56 |
'desc' => "If you have constrained by number of thumbnails per row above, enter the number of thumbnails", |
| 57 |
'id' => "zenfolio_photos_constrain_by_count", |
| 58 |
'grouping' => 'zenfolio-settings', |
| 59 |
'type' => 'select', |
| 60 |
'options' => $this->selection_range(1, 25) |
| 61 |
], |
| 62 |
|
| 63 |
['name' => "Thumbnail size", |
| 64 |
'desc' => "What size should a thumbnail be shown in if no size is specified? Zenfolio lets you display a thumbnail in the following sizes:", |
| 65 |
'id' => "zenfolio_thumb_size", |
| 66 |
'grouping' => 'zenfolio-settings', |
| 67 |
'type' => 'select', |
| 68 |
'options' => [ |
| 69 |
"0" => "Small thumbnail, upto 80 x 80px", |
| 70 |
"1" => "Square thumbnail, 60 x 60px, cropped square", |
| 71 |
"10" => "Medium thumbnail, upto 120 x 120px", |
| 72 |
"11" => "Large thumbnail, upto 120 x 120px", |
| 73 |
"2" => "Small image, upto 400 x 400px", |
| 74 |
] |
| 75 |
], |
| 76 |
|
| 77 |
['name' => "Main image size", |
| 78 |
'desc' => "Show this size for the image in the lightbox:", |
| 79 |
'id' => "zenfolio_main_size", |
| 80 |
'grouping' => 'zenfolio-settings', |
| 81 |
'type' => 'select', |
| 82 |
'options' => [ |
| 83 |
"2" => "Small image, upto 400 x 400px", |
| 84 |
"3" => "Medium image, upto 580 x 450px", |
| 85 |
"4" => "Large image, upto 800 x 630px", |
| 86 |
"5" => "X-Large image, upto 1100 x 850px", |
| 87 |
"6" => "XX-Large image, upto 1550 x 960px", |
| 88 |
] |
| 89 |
], |
| 90 |
|
| 91 |
['name' => "Tile image size", |
| 92 |
'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:", |
| 93 |
'id' => "zenfolio_tile_size", |
| 94 |
'grouping' => 'zenfolio-settings', |
| 95 |
'type' => 'select', |
| 96 |
'options' => [ |
| 97 |
"same" => "Same as Main image size", |
| 98 |
"2" => "Small image, upto 400 x 400px", |
| 99 |
"3" => "Medium image, upto 580 x 450px", |
| 100 |
"4" => "Large image, upto 800 x 630px", |
| 101 |
"5" => "X-Large image, upto 1100 x 850px", |
| 102 |
"6" => "XX-Large image, upto 1550 x 960px", |
| 103 |
] |
| 104 |
], |
| 105 |
|
| 106 |
['name' => 'Video size', |
| 107 |
'desc' => 'Show this size for the video in the lightbox:', |
| 108 |
'id' => "zenfolio_video_size", |
| 109 |
'grouping' => 'zenfolio-settings', |
| 110 |
'type' => 'select', |
| 111 |
'options' => [ |
| 112 |
'220' => "360p resolution (MP4)", |
| 113 |
'215' => "480p resolution (MP4)", |
| 114 |
'210' => "720p resolution (MP4)", |
| 115 |
'200' => "1080p resolution (MP4)", |
| 116 |
] |
| 117 |
], |
| 118 |
|
| 119 |
['name' => "Photo Title Display", |
| 120 |
'desc' => "How do you want the title of the photos?", |
| 121 |
'id' => "zenfolio_photo_title_display", |
| 122 |
'grouping' => 'zenfolio-settings', |
| 123 |
'type' => "radio", |
| 124 |
'options' => $this->title_styles(), |
| 125 |
], |
| 126 |
|
| 127 |
['name' => "Photo titles and captions", |
| 128 |
'desc' => "What do you want to show as the photo title in the tooltip and lightbox?", |
| 129 |
'id' => "zenfolio_title_caption", |
| 130 |
'grouping' => 'zenfolio-settings', |
| 131 |
'type' => 'select', |
| 132 |
'options' => Utilities::title_caption_options() |
| 133 |
], |
| 134 |
|
| 135 |
['name' => "Zenfolio Groups", |
| 136 |
'desc' => "Control settings for Zenfolio Groups", |
| 137 |
'category' => 'zenfolio-groups', |
| 138 |
'type' => 'section',], |
| 139 |
|
| 140 |
['name' => "What is this section?", |
| 141 |
'desc' => "Options in this section are in effect when you use the shortcode format <code>[gallery type='zenfolio' view='hierarchy' ...]</code> or <code>[gallery type='zenfolio' view='group' ...]</code>. They are used to control the Photoset's thumbnail display", |
| 142 |
'grouping' => 'zenfolio-groups', |
| 143 |
'type' => "blurb",], |
| 144 |
|
| 145 |
['name' => "Exclude Empty Groups", |
| 146 |
'desc' => "Do not show groups whose immediate children photosets have no photos.", |
| 147 |
'id' => "zenfolio_hide_empty_groups", |
| 148 |
'grouping' => 'zenfolio-groups', |
| 149 |
'type' => 'checkbox' |
| 150 |
], |
| 151 |
|
| 152 |
['name' => "Hide Group Title", |
| 153 |
'desc' => "This will hide the title for your Zenfolio Group.", |
| 154 |
'id' => "zenfolio_hide_group_title", |
| 155 |
'grouping' => 'zenfolio-groups', |
| 156 |
'type' => 'checkbox' |
| 157 |
], |
| 158 |
|
| 159 |
['name' => "Link to Zenfolio", |
| 160 |
'desc' => "Link the group title (if shown) to the Zenfolio group page", |
| 161 |
'id' => "zenfolio_link_group_page", |
| 162 |
'grouping' => 'zenfolio-groups', |
| 163 |
'type' => 'checkbox' |
| 164 |
], |
| 165 |
|
| 166 |
['name' => "Hide Number of Photos, if available", |
| 167 |
'desc' => "This will hide the number of photos in your Zenfolio Group.", |
| 168 |
'id' => "zenfolio_hide_group_photo_count", |
| 169 |
'grouping' => 'zenfolio-groups', |
| 170 |
'type' => 'checkbox' |
| 171 |
], |
| 172 |
|
| 173 |
['name' => "Hide Number of Sub-Groups, if available", |
| 174 |
'desc' => "This will hide the number of sub-groups in your Zenfolio Group.", |
| 175 |
'id' => "zenfolio_hide_group_group_count", |
| 176 |
'grouping' => 'zenfolio-groups', |
| 177 |
'type' => 'checkbox' |
| 178 |
], |
| 179 |
|
| 180 |
['name' => "Hide Number of Photosets, if available", |
| 181 |
'desc' => "This will hide the number of photosets in your Zenfolio Group.", |
| 182 |
'id' => "zenfolio_hide_group_set_count", |
| 183 |
'grouping' => 'zenfolio-groups', |
| 184 |
'type' => 'checkbox' |
| 185 |
], |
| 186 |
|
| 187 |
['name' => "Zenfolio Photoset Thumbnails (with other Photosets)", |
| 188 |
'desc' => "Control settings for Zenfolio Photoset thumbnails", |
| 189 |
'category' => 'zenfolio-sets', |
| 190 |
'type' => 'section',], |
| 191 |
|
| 192 |
['name' => "What is this section?", |
| 193 |
'desc' => "Options in this section are in effect when you use the shortcode format <code>[gallery type='zenfolio' view='photosets' ...]</code>. They are used to control the Photoset's thumbnail display", |
| 194 |
'grouping' => 'zenfolio-sets', |
| 195 |
'type' => "blurb",], |
| 196 |
|
| 197 |
['name' => "Photoset Title Display", |
| 198 |
'desc' => "How do you want the title of the Photoset?", |
| 199 |
'id' => "zenfolio_set_title_display", |
| 200 |
'grouping' => 'zenfolio-sets', |
| 201 |
'type' => "radio", |
| 202 |
'options' => $this->title_styles(), |
| 203 |
], |
| 204 |
|
| 205 |
['name' => "Hide Photo Count in Title Display", |
| 206 |
'desc' => "This will hide the number of photos in your Photoset's title.", |
| 207 |
'id' => "zenfolio_hide_set_photos_count_display", |
| 208 |
'grouping' => 'zenfolio-sets', |
| 209 |
'type' => 'checkbox' |
| 210 |
], |
| 211 |
|
| 212 |
['name' => "Hide thumbnails for Password-protected sets", |
| 213 |
'desc' => "This will hide the thumbnail of password-protected photosets (Password-protected sets are not currently supported, so it is advisable to hide the thumbnails).", |
| 214 |
'id' => "zenfolio_hide_password_protected_thumbnail", |
| 215 |
'grouping' => 'zenfolio-sets', |
| 216 |
'type' => 'checkbox' |
| 217 |
], |
| 218 |
|
| 219 |
['name' => "Constrain Photosets Per Row", |
| 220 |
'desc' => "How do you want the control the number of photoset thumbnails per row? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.", |
| 221 |
'id' => "zenfolio_sets_per_row_constraint", |
| 222 |
'grouping' => 'zenfolio-sets', |
| 223 |
'type' => 'select', |
| 224 |
'options' => ["padding" => "Fix the padding around the thumbnails", |
| 225 |
"count" => "Fix the number of thumbnails per row", |
| 226 |
] |
| 227 |
], |
| 228 |
|
| 229 |
['name' => "Constrain by padding", |
| 230 |
'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by", |
| 231 |
'id' => "zenfolio_sets_constrain_by_padding", |
| 232 |
'grouping' => 'zenfolio-sets', |
| 233 |
'type' => 'text', |
| 234 |
'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored." |
| 235 |
], |
| 236 |
|
| 237 |
['name' => "Constrain by number of thumbnails", |
| 238 |
'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails", |
| 239 |
'id' => "zenfolio_sets_constrain_by_count", |
| 240 |
'grouping' => 'zenfolio-sets', |
| 241 |
'type' => 'select', |
| 242 |
'options' => $this->selection_range(1, 25) |
| 243 |
], |
| 244 |
|
| 245 |
['name' => "Zenfolio Photoset Header Thumbnails", |
| 246 |
'desc' => "Control settings for Zenfolio Photosets when displayed in your page", |
| 247 |
'category' => 'zenfolio-set', |
| 248 |
'type' => 'section',], |
| 249 |
|
| 250 |
['name' => "What is this section?", |
| 251 |
'desc' => "Options in this section are in effect when you use the shortcode format <code>[gallery type='zenfolio' view='photosets' ...]</code>. In other words, the gallery output for the Photoset is directly on the page, or in a popup and you want to control your Photoset's thumbnail.", |
| 252 |
'grouping' => 'zenfolio-set', |
| 253 |
'type' => "blurb",], |
| 254 |
|
| 255 |
['name' => "Hide Photoset Thumbnail", |
| 256 |
'desc' => "This will hide the thumbnail for your Zenfolio Photoset.", |
| 257 |
'id' => "zenfolio_hide_set_thumbnail", |
| 258 |
'grouping' => 'zenfolio-set', |
| 259 |
'type' => 'checkbox' |
| 260 |
], |
| 261 |
|
| 262 |
['name' => "Hide Photoset Title", |
| 263 |
'desc' => "This will hide the title for your Zenfolio Photoset.", |
| 264 |
'id' => "zenfolio_hide_set_title", |
| 265 |
'grouping' => 'zenfolio-set', |
| 266 |
'type' => 'checkbox' |
| 267 |
], |
| 268 |
|
| 269 |
['name' => "Link to Zenfolio", |
| 270 |
'desc' => "Link the set thumbnail and title (if shown) to the Zenfolio set page", |
| 271 |
'id' => "zenfolio_link_set_page", |
| 272 |
'grouping' => 'zenfolio-set', |
| 273 |
'type' => 'checkbox' |
| 274 |
], |
| 275 |
|
| 276 |
['name' => "Hide Number of Photos", |
| 277 |
'desc' => "This will hide the number of photos in your Zenfolio Photoset.", |
| 278 |
'id' => "zenfolio_hide_set_photo_count", |
| 279 |
'grouping' => 'zenfolio-set', |
| 280 |
'type' => 'checkbox' |
| 281 |
], |
| 282 |
]; |
| 283 |
} |
| 284 |
|
| 285 |
public static function get_instance() { |
| 286 |
if (self::$instance == null) { |
| 287 |
self::$instance = new Zenfolio(); |
| 288 |
} |
| 289 |
return self::$instance; |
| 290 |
} |
| 291 |
} |
| 292 |
|