PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.33
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.33
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 / Getting_Started.php

Getting_Started.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.33, at Admin/Getting_Started.php

815 lines 32.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Photonic_Plugin\Admin;
4
5 if (!defined('ABSPATH')) {
6 echo '<h1>WordPress not loaded!</h1>';
7 exit;
8 }
9
10 require_once 'Admin_Page.php';
11
12 class Getting_Started extends Admin_Page {
13 private static ?Getting_Started $instance = null;
14
15 private function __construct() {
16 // Empty
17 }
18
19 public static function get_instance() {
20 if (null === self::$instance) {
21 self::$instance = new Getting_Started();
22 }
23 return self::$instance;
24 }
25
26 public function render_content() {
27 $this->tabs();
28 $this->capabilities();
29 $this->build_gallery();
30 $this->layouts();
31 $this->lightbox();
32 $this->secret_menu();
33 $this->helper_shortcode();
34 $this->really_technical();
35 }
36
37 private function tabs() {
38 ?>
39 <script type="text/javascript">
40 document.addEventListener('DOMContentLoaded', function () {
41 const photonicStartTabs = document.querySelectorAll('.photonic-options-header-bar .nav-tab');
42 photonicStartTabs.forEach(function (tab) {
43 tab.addEventListener('click', function (e) {
44 e.preventDefault();
45 const hash = tab.getAttribute('href');
46 photonicShowSection(hash);
47 });
48 });
49
50 function photonicShowSection(hash) {
51 let check = 'photonic-start-capabilities';
52 let foundHash = false;
53 if (hash) {
54 check = hash.substr(1);
55 if (['photonic-start-capabilities', 'photonic-start-create', 'photonic-start-layouts', 'photonic-start-lightbox', 'photonic-start-secret', 'photonic-start-helpers', 'photonic-start-tech'].indexOf(check) < 0) {
56 check = 'photonic-start-capabilities';
57 }
58 else {
59 foundHash = true;
60 }
61 }
62
63 photonicStartTabs.forEach(function (tab) {
64 let panel;
65 if (tab.getAttribute('href') === ('#' + check)) {
66 tab.classList.add('nav-tab-active');
67 panel = document.querySelector(tab.getAttribute('href'));
68 panel.classList.add('photonic-panel-visible');
69 if (foundHash) {
70 window.history.pushState({}, document.title, '#' + check);
71 }
72 else {
73 window.history.pushState({}, document.title, '');
74 }
75 }
76 else {
77 tab.classList.remove('nav-tab-active');
78 panel = document.querySelector(tab.getAttribute('href'));
79 panel.classList.remove('photonic-panel-visible');
80 }
81 });
82 }
83
84 let hash = location.hash;
85 photonicShowSection(hash);
86 });
87 </script>
88 <div class="photonic-tabbed-start">
89 <div class="photonic-header-nav">
90 <div class="photonic-options-header-bar fix">
91 <h2 class='nav-tab-wrapper'>
92 <a class='nav-tab' id='photonic-start-tab-capabilities' href='#photonic-start-capabilities'>Overview</a>
93 <a class='nav-tab' id='photonic-start-tab-create' href='#photonic-start-create'>Create
94 Galleries</a>
95 <a class='nav-tab' id='photonic-start-tab-layouts' href='#photonic-start-layouts'>Layouts</a>
96 <a class='nav-tab' id='photonic-start-tab-lightbox'
97 href='#photonic-start-lightbox'>Lightboxes</a>
98 <a class='nav-tab' id='photonic-start-tab-secret' href='#photonic-start-secret'>Secret Menu</a>
99 <a class='nav-tab' id='photonic-start-tab-helpers' href='#photonic-start-helpers'>Helpers</a>
100 <a class='nav-tab' id='photonic-start-tab-tech' href='#photonic-start-tech'>Technical Stuff</a>
101 </h2>
102 </div>
103 </div>
104 </div><!-- /#photonic-tabbed-options -->
105 <?php
106 }
107
108 private function capabilities() {
109 ?>
110 <div id="photonic-start-capabilities" class="photonic-start-panel">
111 <h2 class="photonic-section">Capabilities and Documentation</h2>
112 <p>
113 Photonic can show you photos and galleries not just from standard WordPress, but also from several
114 third-party photo-hosting providers
115 such as Flickr, SmugMug, Google Photos etc. The following table tells you what you need for each
116 provider, and provides you with
117 documentation links for how to show something using Photonic.
118 </p>
119
120 <table class="form-table photonic-form-table">
121 <tr>
122 <th rowspan="2" class="theader">Provider</th>
123 <th colspan="4" class="theader">What Can You Show?</th>
124 <th rowspan="2" class="theader">Authentication</th>
125 <th rowspan="2" class="theader">Lightbox Support</th>
126 </tr>
127
128 <tr>
129 <th class="theader">Single Photo<br/>(Level 0)</th>
130 <th class="theader">Photos / Videos<br/>(Level 1)</th>
131 <th class="theader">Albums / Sets / Galleries<br/>(Level 2)</th>
132 <th class="theader">Collections / Groups<br/>(Level 3)</th>
133 </tr>
134
135 <tr>
136 <th>Native WP</th>
137 <td>Not supported</td>
138 <td><a href="https://aquoid.com/plugins/photonic/wp-galleries/">Standard gallery photos</a>, no
139 videos in WP galleries
140 </td>
141 <td><a href="https://aquoid.com/plugins/photonic/wp-galleries/">Standard galleries</a></td>
142 <td>No such feature in WP</td>
143 <td>No such feature in WP</td>
144 <td>All</td>
145 </tr>
146
147 <tr>
148 <th>
149 Flickr<br/>
150 <em><a href="https://www.flickr.com/services/api/misc.api_keys.html">API Key
151 Required</a></em><br/>
152 <em>See <a href="https://aquoid.com/plugins/photonic/flickr/#api-key">Instructions</a></em>
153 </th>
154 <td><a href="https://aquoid.com/plugins/photonic/flickr/flickr-photo/">Supported</a></td>
155 <td><a href="https://aquoid.com/plugins/photonic/flickr/flickr-photos/">User Photos, Videos and
156 Group Pools</a></td>
157 <td><a href="https://aquoid.com/plugins/photonic/flickr/flickr-photosets/">Albums / Photosets</a>
158 and <a href="https://aquoid.com/plugins/photonic/flickr/flickr-galleries/">Galleries</a></td>
159 <td><a href="https://aquoid.com/plugins/photonic/flickr/flickr-collections/">Collections, with lazy
160 loading</a></td>
161 <td><a href="https://aquoid.com/plugins/photonic/flickr/flickr-authentication/">Required to share
162 private photos</a></td>
163 <td>All; Image Lightbox, PrettyPhoto and StripJS cannot handle videos; Lightcase shows Flash videos
164 for Flickr
165 </td>
166 </tr>
167
168 <tr>
169 <th>
170 SmugMug<br/>
171 <em><a href="https://api.smugmug.com/api/developer/apply">API Key required for private
172 photos</a></em><br/>
173 <em>See <a href="https://aquoid.com/plugins/photonic/smugmug/#api-key">instructions</a></em>
174 </th>
175 <td>Not supported</td>
176 <td><a href="https://aquoid.com/plugins/photonic/smugmug/smugmug-photos/">User photos and videos</a>
177 </td>
178 <td><a href="https://aquoid.com/plugins/photonic/smugmug/smugmug-albums/">Albums</a></td>
179 <td><a href="https://aquoid.com/plugins/photonic/smugmug/smugmug-tree/">User tree</a> and <a
180 href="https://aquoid.com/plugins/photonic/smugmug/folders/">Folders</a></td>
181 <td><a href="https://aquoid.com/plugins/photonic/smugmug/smugmug-albums/#protected">Password-protection</a>,
182 <a href="https://aquoid.com/plugins/photonic/authentication/#back-end">Authentication to share
183 your private photos</a></td>
184 <td>All; Image Lightbox, PrettyPhoto and StripJS cannot handle videos</td>
185 </tr>
186
187 <tr>
188 <th>
189 Google Photos<br/>
190 <a href="https://console.developers.google.com/apis/">Client ID required</a><br/>
191 <a href="https://aquoid.com/plugins/photonic/google-photos/#auth">Authentication required</a>
192 </th>
193 <td>Not supported</td>
194 <td><a href="https://aquoid.com/plugins/photonic/google-photos/photos/">Photos and Videos</a></td>
195 <td><a href="https://aquoid.com/plugins/photonic/google-photos/albums/">Albums</a></td>
196 <td>No such feature in Google Photos</td>
197 <td><a href="https://aquoid.com/plugins/photonic/google-photos/#auth">Back-end authentication</a>
198 </td>
199 <td>All; Fancybox, Featherlight, Image Lightbox, PrettyPhoto and StripJS cannot handle videos</td>
200 </tr>
201
202 <tr>
203 <th>Zenfolio</th>
204 <td><a href="https://aquoid.com/plugins/photonic/zenfolio/photos/#individual">Supported</a></td>
205 <td><a href="https://aquoid.com/plugins/photonic/zenfolio/photosets/">User</a> and <a
206 href="https://aquoid.com/plugins/photonic/zenfolio/photos/">Generic</a> photos and
207 videos
208 </td>
209 <td><a href="https://aquoid.com/plugins/photonic/zenfolio/photosets/">Photosets (Galleries and
210 Collections)</a></td>
211 <td><a href="https://aquoid.com/plugins/photonic/zenfolio/groups/">Groups</a> and <a
212 href="https://aquoid.com/plugins/photonic/zenfolio/group-hierarchy/">Group
213 hierarchies</a></td>
214 <td><a href="https://aquoid.com/plugins/photonic/zenfolio/groups/">Password-protection supported</a>,
215 authentication not supported
216 </td>
217 <td>All; Image Lightbox, PrettyPhoto and StripJS cannot handle videos</td>
218 </tr>
219
220 <tr>
221 <th>
222 Instagram<br/>
223 <a href="https://aquoid.com/plugins/photonic/instagram/#auth-setup">Authentication required</a>
224 </th>
225 <td><a href="https://aquoid.com/plugins/photonic/instagram/#photo-of-the-day">Supported</a></td>
226 <td><a href="https://aquoid.com/plugins/photonic/instagram/#own-photos">User photos and videos</a>
227 </td>
228 <td>No such feature in Instagram</td>
229 <td>No such feature in Instagram</td>
230 <td><a href="https://aquoid.com/plugins/photonic/instagram/#auth-setup">Back-end / server-side</a>
231 </td>
232 <td>All; Image Lightbox, PrettyPhoto and StripJS cannot handle videos</td>
233 </tr>
234 </table>
235 </div>
236 <?php
237 }
238
239 private function build_gallery() {
240 ?>
241 <div id="photonic-start-create" class="photonic-start-panel">
242 <h2 class="photonic-section">Showing a Gallery</h2>
243 <p>
244 While using the Classic Editor a gallery is displayed using the <code>[gallery]</code> shortcode. If the
245 Gutenberg Block Editor is
246 used a gallery is displayed using a Gutenberg Block instead. Given the plethora of options and
247 configurations offered in Photonic,
248 things have been made easier by virtue of a shortcode insertion UI. To use it:
249 </p>
250
251 <ol>
252 <li>
253 <h4>Getting Started</h4>
254 If you are using the "Classic Editor" click on the "Add Media" button or the "Add / Edit Photonic
255 Gallery" button:<br/>
256 <img src="<?php echo esc_url(PHOTONIC_URL) . 'screenshot-2.jpg'; ?>" alt="'Add Media' Button"/><br/><br/>
257
258 Correspondingly if you are using "Gutenberg" use the Photonic Gallery block:<br/>
259 <img src="<?php echo esc_url(PHOTONIC_URL) . 'screenshot-1.png'; ?>" alt="Gutenberg Block"/>
260 </li>
261
262 <li>
263 <h4>Building a Gallery</h4>
264 <ol>
265 <li>
266 <strong>Via "Add Media"</strong>
267 <ol>
268 <li>
269 Click on the "Photonic" tab:<br/>
270 <img src="<?php echo esc_url(PHOTONIC_URL) . 'screenshot-5.jpg'; ?>"
271 alt="Media Uploader"/><br/>
272 </li>
273 <li>
274 Pick your source:<br/>
275 <img src="<?php echo esc_url(PHOTONIC_URL) . 'screenshot-6.jpg'; ?>"
276 alt="Sources in Media Uploader"/><br/>
277 </li>
278 <li>
279 Fill out the attributes for the gallery:<br/>
280 <img src="<?php echo esc_url(PHOTONIC_URL) . 'screenshot-8.png'; ?>"
281 alt="Gallery attributes"/><br/>
282 </li>
283 </ol>
284 </li>
285 <li>
286 <strong>Wizard Via "Add / Edit Photonic Gallery", or the "Photonic Gallery" block</strong>
287 <ol>
288 <li>
289 You are presented with a wizard to pick the source for your gallery:<br/>
290 <img src="<?php echo esc_url(PHOTONIC_URL) . 'screenshot-3.png'; ?>"
291 alt="Wizard Starting Screen"/><br/>
292 </li>
293 <li>
294 You will be shown a contextual set of options based on your choices:<br/>
295 <img src="<?php echo esc_url(PHOTONIC_URL) . 'screenshot-4.png'; ?>"
296 alt="Contextual options in the Wizard"/><br/>
297 </li>
298 </ol>
299 </li>
300 </ol>
301 </li>
302 <li>
303 Depending on which gallery you inserted you will be shown a placeholder of this sort:<br/>
304 <img src="<?php echo esc_url(PHOTONIC_URL) . 'screenshot-7.png'; ?>"
305 alt="Gallery shows up with a placeholder"/>
306 </li>
307 <li>
308 Clicking on the placeholder will let you edit the gallery you inserted.<br/>
309 Note that if you are using the Visual Editor, you <em>may</em> encounter TinyMCE conflicts with
310 other plugins. In case of such a conflict
311 please <a href="https://wordpress.org/support/plugin/photonic/">report a bug</a>, and disable the
312 Visual Editor integration from
313 <em>Photonic &rarr; Settings &rarr; Generic Options &rarr; Generic Settings &rarr; Disable shortcode
314 editing in Visual Editor</em>. The plugin will
315 continue working normally &ndash; the only difference is that you will have to do shortcode edits by
316 hand via the Text Editor rather than via a UI
317 in the Visual Editor.
318 </li>
319 </ol>
320 </div>
321 <?php
322 }
323
324 private function layouts() {
325 ?>
326 <div id="photonic-start-layouts" class="photonic-start-panel">
327 <h2 class="photonic-section">Gallery Layouts</h2>
328 <p>
329 Photonic supports the following types of layouts:
330 </p>
331 <ol>
332 <li><a href="https://aquoid.com/plugins/photonic/layouts/#square">Square thumbnails</a></li>
333 <li><a href="https://aquoid.com/plugins/photonic/layouts/#circle">Circular thumbnails</a></li>
334 <li><a href="https://aquoid.com/plugins/photonic/layouts/#slideshow">Slideshow</a></li>
335 <li><a href="https://aquoid.com/plugins/photonic/layouts/#justified">Random Justified Grid</a></li>
336 <li><a href="https://aquoid.com/plugins/photonic/layouts/#masonry">Masonry</a></li>
337 <li><a href="https://aquoid.com/plugins/photonic/layouts/#mosaic">Mosaic</a></li>
338 </ol>
339 </div>
340 <?php
341 }
342
343 private function lightbox() {
344 $lightboxes = [
345 'baguetteBox' => [
346 'name' => 'BaguetteBox',
347 'url' => 'https://feimosi.github.io/baguetteBox.js/',
348 'size' => '~10KB JS, ~4KB CSS',
349 'supports' => ['bundled', 'deepLinking', 'html5', 'noJQ', 'socialSharing', 'touch'],
350 'license' => 'MIT',
351 'notes' => 'No support for YouTube / Vimeo',
352 ],
353 'bigPicture' => [
354 'name' => 'BigPicture',
355 'url' => 'https://henrygd.me/bigpicture/',
356 'size' => '~9KB JS, no CSS',
357 'supports' => ['bundled', 'deepLinking', 'html5', 'noJQ', 'socialSharing', 'touch', 'ytVimeo'],
358 'license' => 'MIT',
359 'notes' => 'No support for videos in galleries',
360 ],
361 'colorbox' => [
362 'name' => 'Colorbox',
363 'url' => 'https://jacklmoore.com/colorbox/',
364 'size' => '~10KB JS, 5KB CSS',
365 'supports' => ['autoStart', 'bundled', 'deepLinking', 'html5', 'socialSharing', 'touch', 'ytVimeo'],
366 'license' => 'MIT',
367 ],
368 'fancybox' => [
369 'name' => 'Fancybox1',
370 'url' => 'http://fancybox.net/',
371 'size' => '~16KB JS, 9KB CSS',
372 'supports' => ['autoStart', 'html5', 'touch', 'ytVimeo'],
373 'license' => 'MIT, GPL',
374 ],
375 'fancybox2' => [
376 'name' => 'Fancybox2',
377 'url' => 'https://fancyapps.com/fancybox/',
378 'size' => '~23KB JS, 5KB CSS',
379 'supports' => ['autoStart', 'deepLinking', 'socialSharing', 'html5', 'thumbnails', 'touch', 'ytVimeo'],
380 'license' => 'CC-BY-NC 3.0',
381 ],
382 'fancybox3' => [
383 'name' => 'Fancybox3',
384 'url' => 'https://fancyapps.com/fancybox/3',
385 'size' => '~61KB JS, 14KB CSS',
386 'supports' => ['autoStart', 'bundled', 'deepLinking', 'html5', 'socialSharing', 'thumbnails', 'touch', 'ytVimeo'],
387 'license' => 'GPL v3',
388 ],
389 'featherlight' => [
390 'name' => 'Featherlight',
391 'url' => 'https://noelboss.github.io/featherlight/',
392 'size' => '~13KB JS, 5KB CSS',
393 'supports' => ['bundled', 'deepLinking', 'html5', 'socialSharing', 'touch', 'ytVimeo'],
394 'license' => 'MIT',
395 ],
396 'glightbox' => [
397 'name' => '"Gie" Lightbox (GLightbox)',
398 'url' => 'https://biati-digital.github.io/glightbox/',
399 'size' => '~54KB JS, 14KB CSS',
400 'supports' => ['bundled', 'deepLinking', 'html5', 'noJQ', 'socialSharing', 'touch', 'ytVimeo'],
401 'license' => 'MIT',
402 ],
403 'imageLightbox' => [
404 'name' => 'Image Lightbox',
405 'url' => 'https://osvaldas.info/image-lightbox-responsive-touch-friendly',
406 'size' => '~6KB JS, 5KB CSS',
407 'supports' => ['bundled', 'deepLinking', 'socialSharing', 'touch'],
408 'license' => 'MIT',
409 'notes' => 'No video support',
410 ],
411 'lightCase' => [
412 'name' => 'LightCase',
413 'url' => 'https://cornel.bopp-art.com/lightcase/',
414 'size' => '~26KB JS, 14KB CSS',
415 'supports' => ['autoStart', 'bundled', 'deepLinking', 'html5', 'socialSharing', 'touch', 'ytVimeo'],
416 'license' => 'GPL',
417 ],
418 'lightGallery' => [
419 'name' => 'LightGallery',
420 'url' => 'https://lightgalleryjs.com/',
421 'size' => '~52KB JS, 21KB CSS, ~26KB Fonts, + Additional Plugins',
422 'supports' => ['autoStart', 'bundled', 'deepLinking', 'html5', 'noJQ', 'socialSharing', 'thumbnails', 'touch', 'ytVimeo'],
423 'license' => 'GPL v3',
424 ],
425 'magnific' => [
426 'name' => 'Magnific Popup',
427 'url' => 'https://dimsemenov.com/plugins/magnific-popup/',
428 'size' => '~20KB JS, 7KB CSS',
429 'supports' => ['deepLinking', 'html5', 'socialSharing', 'touch', 'ytVimeo'],
430 'license' => 'MIT',
431 ],
432 'photoSwipe' => [
433 'name' => 'PhotoSwipe',
434 'url' => 'https://github.com/dimsemenov/PhotoSwipe/tree/v4.1.3',
435 'size' => '~41KB JS, 11KB CSS',
436 'supports' => ['bundled', 'deepLinking', 'html5', 'noJQ', 'socialSharing', 'touch', 'ytVimeo'],
437 'license' => 'MIT',
438 'notes' => 'No video support for Flickr',
439 ],
440 'photoSwipe5' => [
441 'name' => 'PhotoSwipe v5',
442 'url' => 'https://photoswipe.com/',
443 'size' => '~66KB JS, 5KB CSS',
444 'supports' => ['bundled', 'deepLinking', 'html5', 'noJQ', 'socialSharing', 'touch', 'ytVimeo'],
445 'license' => 'MIT',
446 'notes' => 'No video support for Flickr',
447 ],
448 'prettyPhoto' => [
449 'name' => 'PrettyPhoto',
450 'url' => 'http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/',
451 'size' => '~23KB JS, 27KB CSS',
452 'supports' => ['autoStart', 'deepLinking', 'socialSharing', 'thumbnails', 'touch', 'ytVimeo'],
453 'license' => 'GPL v2.0',
454 'notes' => 'YouTube / Vimeo supported, but not other videos'
455 ],
456 'strip' => [
457 'name' => 'Strip',
458 'url' => 'http://stripjs.com',
459 'size' => '~39KB JS, 13KB CSS',
460 'supports' => ['bundled', 'deepLinking', 'touch', 'ytVimeo'],
461 'license' => 'CC-BY 4.0',
462 'notes' => 'YouTube / Vimeo supported, but not other videos',
463 ],
464 'spotlight' => [
465 'name' => 'Spotlight',
466 'url' => 'https://nextapps-de.github.io/spotlight/',
467 'size' => '~10KB JS, 11KB CSS',
468 'supports' => ['autoStart', 'bundled', 'deepLinking', 'html5', 'noJQ', 'socialSharing', 'touch', 'ytVimeo'],
469 'license' => 'Apache 2.0',
470 ],
471 'swipebox' => [
472 'name' => 'Swipebox',
473 'url' => 'https://brutaldesign.github.io/swipebox/',
474 'size' => '~12KB JS, 5KB CSS',
475 'supports' => ['bundled', 'deepLinking', 'html5', 'socialSharing', 'touch', 'ytVimeo'],
476 'license' => 'MIT',
477 ],
478 'thickbox' => [
479 'name' => 'Thickbox',
480 'url' => 'http://codylindley.com/thickbox/',
481 'size' => '~12KB JS',
482 'supports' => ['bundled', 'deepLinking', 'html5', 'socialSharing', 'touch', 'ytVimeo'],
483 'license' => 'MIT',
484 'notes' => 'No video support'
485 ],
486 'venobox' => [
487 'name' => 'VenoBox',
488 'url' => 'https://veno.es/venobox/',
489 'size' => '~16KB JS, ~15KB CSS',
490 'supports' => ['bundled', 'deepLinking', 'html5', 'noJQ', 'socialSharing', 'touch', 'ytVimeo'],
491 'license' => 'MIT',
492 ],
493 ];
494 $lightboxes_json = wp_json_encode($lightboxes);
495
496 $supports = [
497 'autoStart' => '<abbr title="When you open a gallery in a lightbox, this lets the lightbox run in a slideshow mode automatically without the user driving the navigation.">Auto-start slideshow</abbr>',
498 'bundled' => 'Bundled with Photonic',
499 'deepLinking' => '<abbr title="Deep-linking assigns a URL to every image in a gallery. If you enter that URL directly in a browser\'s address bar, it automatically opens the image in a lightbox.">Deep-linking</abbr>',
500 'html5' => 'HTML5 Videos from Flickr etc.',
501 'noJQ' => 'No <abbr title="jQuery adds a ~95KB file to the pages. It is commonly used by themes and plugins, so even if Photonic doesn\'t load jQuery, something else might.">jQuery</abbr> required',
502 'socialSharing' => '<abbr title="If deep-linking is enabled, you have the option to display social sharing links. Photonic can help you share links on Facebook, Twitter and Google+.">Social Sharing</abbr>',
503 'thumbnails' => '<abbr title="This capability helps display thumbnails for all your images within the lightbox.">Thumbnails</abbr>',
504 'touch' => 'Touch / gestures',
505 'ytVimeo' => 'YouTube, Vimeo etc.',
506 ];
507 ?>
508 <div id="photonic-start-lightbox" class="photonic-start-panel">
509 <h2 class="photonic-section">Which Lightbox?</h2>
510 <p>
511 Photonic includes several lightboxes and supports some others that it cannot include due to licensing
512 reasons. Each lightbox has
513 its own strengths &mdash; some are lightweight, some are full-featured and some are very elegant
514 looking. You can pick one based on the
515 features that you feel are most important to you. Note that out-of-the-box, several of these don't
516 support features such as touch gestures, or deep-linking,
517 but for Photonic those capabilities have been integrated into the scripts via other approaches.
518 </p>
519
520 <table class="form-table photonic-form-table" id="photonic-lightboxes">
521 <tr>
522 <th>Features</th>
523 <th>Lightboxes</th>
524 </tr>
525
526 <tr>
527 <td id="lightbox-features">
528 <ul>
529 <?php
530 foreach ($supports as $feature => $text) {
531 ?>
532 <li>
533 <label>
534 <input type="checkbox" value="<?php echo esc_attr($feature); ?>" />
535 <?php echo wp_kses_post($text); ?>
536 </label>
537 </li>
538 <?php
539 }
540 ?>
541 </ul>
542 </td>
543
544 <td id="lightbox-list">
545 <ul>
546 <?php
547 foreach ($lightboxes as $lb => $lightbox) {
548 ?>
549 <li id="photonic-lb-<?php echo esc_attr($lb); ?>">
550 <button id="photonic-lb-button-<?php echo esc_attr($lb); ?>"
551 style="border: none; cursor: pointer; ">
552 <span class="dashicons dashicons-forms"></span>
553 </button>
554 <a href="<?php echo esc_url($lightbox['url']); ?>"><?php echo wp_kses_post($lightbox['name']); ?></a>
555 (<?php echo wp_kses_post($lightbox['size']); ?>)
556 <strong>License</strong> &ndash; <?php echo wp_kses_post($lightbox['license']); ?>
557 <?php
558 if (!empty($lightbox['notes'])) {
559 ?>
560 ; <?php echo wp_kses_post($lightbox['notes']); ?>
561 <?php
562 }
563 ?>
564 </li>
565 <?php
566 }
567 ?>
568 </ul>
569 </td>
570 </tr>
571 <script type="text/javascript">
572 document.addEventListener('DOMContentLoaded', function () {
573 const lightboxes = <?php echo wp_kses_post($lightboxes_json); ?>;
574 const checkboxes = document.querySelectorAll('#lightbox-features input');
575 let matches;
576 checkboxes.forEach(function (checkbox) {
577 checkbox.addEventListener('change', function () {
578 photonicResetButtonsAndCheckboxes(false, false);
579 const checked = document.querySelectorAll('#lightbox-features input:checked');
580 matches = [];
581 let iterator = 0;
582 checked.forEach(function (feature) {
583 for (const [key, value] of Object.entries(lightboxes)) {
584 if (iterator === 0 || matches.indexOf(key) >= 0) {
585 const inArray = (matches.indexOf(key) >= 0);
586 const supportList = value.supports;
587 let found = false;
588 for (let idx = 0; idx < supportList.length; idx++) {
589 if (typeof supportList[idx] === 'string') {
590 if (feature.value === supportList[idx]) {
591 if (!inArray) {
592 matches.push(key)
593 }
594 found = true;
595 break;
596 }
597 }
598 else {
599 if (feature.value === supportList[idx].type) {
600 if (!inArray) {
601 matches.push(key);
602 }
603 found = true;
604 break;
605 }
606 }
607 }
608
609 if (!found) {
610 const pos = matches.indexOf(key);
611 if (pos > -1) {
612 matches.splice(pos, 1);
613 }
614 }
615 }
616 }
617 iterator++;
618 });
619 photonicShowLightboxMatches(checked, matches);
620 });
621 });
622
623 const buttons = document.querySelectorAll('#lightbox-list button');
624 buttons.forEach(function (button) {
625 button.addEventListener('click', function (e) {
626 e.preventDefault();
627 photonicShowLightboxFeatures(button);
628 });
629 });
630
631 function photonicShowLightboxMatches(checked, matches) {
632 let all = document.querySelectorAll('#lightbox-list li');
633 all.forEach(function (line) {
634 const lb = line.getAttribute('id').substr(12);
635 line.classList.remove('matching');
636 line.classList.remove('not-matching');
637 if (checked.length > 0 && matches.indexOf(lb) > -1) {
638 line.classList.add('matching');
639 }
640 else if (checked.length > 0 && matches.indexOf(lb) < 0) {
641 line.classList.add('not-matching');
642 }
643 });
644 }
645
646 function photonicShowLightboxFeatures(button) {
647 const lightbox = button.getAttribute('id').substring('photonic-lb-button-'.length);
648 if (lightboxes[lightbox]) {
649 photonicResetButtonsAndCheckboxes(true, true);
650 checkboxes.forEach(function (checkbox) {
651 const li = checkbox.closest('li');
652 if (lightboxes[lightbox]['supports'].indexOf(checkbox.value) > -1) {
653 li.classList.remove('photonic-not-supported');
654 li.classList.add('photonic-supported');
655 }
656 else {
657 li.classList.remove('photonic-supported');
658 li.classList.add('photonic-not-supported');
659 }
660 });
661
662 button.closest('li').classList.add('lb-selected');
663 }
664 }
665
666 function photonicResetButtons(unmatch) {
667 let remove = ['lb-selected'];
668 if (unmatch) {
669 remove = remove.concat(['matching', 'not-matching']);
670 }
671 buttons.forEach(function (button) {
672 const li = button.closest('li');
673 remove.forEach(function (css) {
674 li.classList.remove(css);
675 })
676 });
677 }
678
679 function photonicResetCheckboxes(uncheck) {
680 checkboxes.forEach(function (checkbox) {
681 if (uncheck) {
682 checkbox.checked = false;
683 }
684 checkbox.closest('li').classList.remove('photonic-supported', 'photonic-not-supported');
685 });
686 }
687
688 function photonicResetButtonsAndCheckboxes(unmatch, uncheck) {
689 photonicResetButtons(unmatch);
690 photonicResetCheckboxes(uncheck);
691 }
692 });
693 </script>
694 </table>
695 </div>
696 <?php
697 }
698
699 private function secret_menu() {
700 ?>
701 <div id="photonic-start-secret" class="photonic-start-panel">
702 <h2 class="photonic-section">The Secret Menu</h2>
703 <p>
704 While the shortcode generator for Photonic is fairly comprehensive, there are some additional hidden
705 shortcode parameters that you can use. These are baked into the
706 interactive shortcode builder / Photonic block for Gutenberg, but will not show up in the traditional
707 shortcode interface:
708 </p>
709 <ol>
710 <li><code>title_position</code> &ndash; Takes values <code>none</code>, <code>regular</code>, <code>tooltip</code>,
711 <code>below</code>, <code>hover-slideup-show</code> and <code>slideup-stick</code>. It overrides the
712 title positioning that you have set for that particular provider through your options.
713 </li>
714 <li><code>headers</code> &ndash; Takes a comma-separated list containing none or more of
715 <code>thumbnail</code>, <code>title</code>, and <code>counter</code>.
716 If a value is specified, that particular component will be shown in the level 2 entity's (i.e. album
717 / gallery / set) header, regardless of the back-end options.
718 So, setting <code>headers='title,counter'</code> for a particular call to display a Zenfolio set,
719 will show the title and photo-count for that set in the header, and not its thumbnail.
720 </li>
721 <li><code>fx</code> &ndash; Applicable to slideshow layouts. Takes values <code>fade</code> and <code>slide</code>
722 to provide the transitioning effect between slides.
723 </li>
724 <li><code>speed</code> &ndash; Applicable to slideshow layouts. Takes numeric values in milliseconds,
725 determines the speed of transitioning of slides.
726 </li>
727 <li><code>timeout</code> &ndash; Applicable to slideshow layouts. Takes numeric values in milliseconds,
728 determines the pause between two slides.
729 </li>
730 <li><code>pause</code> &ndash; Applicable to slideshow layouts. Takes values <code>0</code> (no pause)
731 and <code>1</code> (pause), determines if the slideshow should pause upon hovering on it.
732 </li>
733 <li><code>controls</code> &ndash; Applicable to slideshow layouts. Takes values <code>show</code> and
734 <code>hide</code>, and shows "Previous" and "Next" buttons on the slideshow.
735 </li>
736 <li><code>strip-style</code> &ndash; Applicable to slideshow layouts. Takes values <code>thumbs</code>
737 and <code>button</code>. If set, and if the <code>layout</code> / <code>style</code> parameter is
738 set to <code>strip-below</code>, <code>strip-above</code>, <code>strip-right</code>, it shows
739 buttons <strong>below</strong> the slideshow.
740 </li>
741 <li><code>popup</code> &ndash; Takes values <code>show</code> and <code>hide</code>. If set, and if a
742 level 2 thumbnail (i.e. an Album, Photoset or Gallery thumbnail) is being displayed, this setting
743 overrides <em>Photonic &rarr; Settings &rarr; Generic Options &rarr; Overlaid Popup Panel &rarr;
744 Enable Interim Popup for Album Thumbnails</em>.
745 </li>
746 </ol>
747 </div>
748 <?php
749 }
750
751 private function helper_shortcode() {
752 ?>
753 <div id="photonic-start-helpers" class="photonic-start-panel">
754 <h2 class="photonic-section">The Helper Shortcode</h2>
755 <p>
756 There is a second utility shortcode present in the plugin, which displays the output of the helpers but
757 <em>in the front-end</em>.
758 </p>
759 <ol>
760 <li><strong>Short-code: </strong><code>photonic_helper</code></li>
761 <li>
762 <strong>Attributes: </strong> This primary attribute is <code>type</code>. Depending on the value of
763 <code>type</code> other attributes can be passed:
764 <ol>
765 <li>
766 <code>type='flickr'</code> - Additional attributes:
767 <ol>
768 <li><code>user='xxx'</code> - Passing the user name (i.e. from
769 https://flickr.com/photos/xxx) will get the user_id for use in the Flickr shortcode
770 </li>
771 <li><code>group='yyy'</code> - Passing the group name will get the group_id for use in
772 the Flickr shortcode
773 </li>
774 </ol>
775 </li>
776 <li>
777 <code>type='google'</code> - Additional attributes:
778 <ol>
779 <li><code>album_type='self'</code> - Prints out the user's Google Photos albums in
780 tabular form
781 </li>
782 <li><code>album_type='shared'</code> - Prints out the all Google Photos albums shared
783 with and by the user in tabular form
784 </li>
785 </ol>
786 </li>
787 </ol>
788 </li>
789 </ol>
790 </div>
791 <?php
792 }
793
794 private function really_technical() {
795 ?>
796 <div id="photonic-start-tech" class="photonic-start-panel">
797 <h2 class="photonic-section">The Really Technical Stuff</h2>
798 <p>
799 You are running PHP with the following details:
800 </p>
801 <table class="form-table photonic-form-table">
802 <tr>
803 <th>PHP Version</th>
804 <td><?php echo wp_kses_post(phpversion()); ?></td>
805 </tr>
806 <tr>
807 <th>Loaded Extensions</th>
808 <td><?php echo wp_kses_post(implode(', ', get_loaded_extensions())); ?></td>
809 </tr>
810 </table>
811 </div>
812 <?php
813 }
814 }
815