js
1 month ago
class-image-viewer-gallery-template.php
1 month ago
gallery-image-viewer.php
1 month ago
gallery-image-viewer.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit; |
| 5 | } |
| 6 | |
| 7 | /** |
| 8 | * FooGallery Image Viewer gallery template |
| 9 | * This is the template that is run when a FooGallery shortcode is rendered to the frontend |
| 10 | */ |
| 11 | //the current FooGallery that is currently being rendered to the frontend |
| 12 | global $current_foogallery; |
| 13 | //the current shortcode args |
| 14 | global $current_foogallery_arguments; |
| 15 | |
| 16 | $text_prev_default = foogallery_get_setting( 'language_imageviewer_prev_text', __( 'Prev', 'foogallery' ) ); |
| 17 | $text_prev = foogallery_gallery_template_setting( 'text-prev', $text_prev_default ) ; |
| 18 | |
| 19 | $text_of_default = foogallery_get_setting( 'language_imageviewer_of_text', __( 'of', 'foogallery' ) ); |
| 20 | $text_of = foogallery_gallery_template_setting( 'text-of', $text_of_default ); |
| 21 | |
| 22 | $text_next_default = foogallery_get_setting( 'language_imageviewer_next_text', __('Next', 'foogallery') ); |
| 23 | $text_next = foogallery_gallery_template_setting( 'text-next', $text_next_default ); |
| 24 | |
| 25 | //get which lightbox we want to use |
| 26 | $lightbox = foogallery_gallery_template_setting_lightbox(); |
| 27 | $alignment = foogallery_gallery_template_setting( 'alignment', 'fg-center' ); |
| 28 | $link = foogallery_gallery_template_setting( 'thumbnail_link', 'image' ); |
| 29 | $foogallery_imageviewer_classes = foogallery_build_class_attribute_safe( $current_foogallery, 'foogallery-link-' . $link, 'foogallery-lightbox-' . $lightbox, $alignment ); |
| 30 | $foogallery_imageviewer_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_imageviewer_classes ) ); |
| 31 | ?><div <?php echo $foogallery_imageviewer_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| 32 | <div class="fiv-inner"> |
| 33 | <div class="fiv-inner-container"> |
| 34 | <?php foreach ( foogallery_current_gallery_attachments_for_rendering() as $attachment ) { |
| 35 | echo foogallery_attachment_html( $attachment ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 36 | } ?> |
| 37 | </div> |
| 38 | <div class="fiv-ctrls"> |
| 39 | <button type="button" class="fiv-prev" title="<?php echo esc_attr( $text_prev ); ?>"><span><?php echo esc_html( $text_prev ); ?></span></button> |
| 40 | <label class="fiv-count"><span class="fiv-count-current">1</span><?php echo esc_html( $text_of ); ?><span class="fiv-count-total"><?php echo esc_html( $current_foogallery->attachment_count() ); ?></span></label> |
| 41 | <button type="button" class="fiv-next" title="<?php echo esc_attr( $text_next ); ?>"><span><?php echo esc_html( $text_next ); ?></span></button> |
| 42 | </div> |
| 43 | </div> |
| 44 | </div> |
| 45 |