class-gallery-api.php
4 months ago
class-gallery-base.php
4 months ago
class-gallery-config.php
4 months ago
class-gallery-design.php
4 months ago
class-gallery-field-provider.php
4 months ago
class-gallery-images.php
4 months ago
class-gallery-lightbox.php
4 months ago
class-gallery-misc.php
4 months ago
class-gallery-paging.php
4 months ago
trait-gallery-ajax.php
4 months ago
trait-gallery-duplicate.php
4 months ago
trait-gallery-image-methods.php
2 weeks ago
trait-gallery-preview.php
4 months ago
trait-gallery-sanitize.php
4 months ago
class-gallery-paging.php
90 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Responsive Lightbox Gallery Paging Settings |
| 4 | * |
| 5 | * Handles gallery pagination options. |
| 6 | * |
| 7 | * @package Responsive_Lightbox |
| 8 | */ |
| 9 | |
| 10 | // exit if accessed directly |
| 11 | if ( ! defined( 'ABSPATH' ) ) |
| 12 | exit; |
| 13 | |
| 14 | /** |
| 15 | * Responsive_Lightbox_Gallery_Paging class. |
| 16 | * |
| 17 | * Gallery paging tab - implements pagination settings. |
| 18 | * |
| 19 | * @class Responsive_Lightbox_Gallery_Paging |
| 20 | */ |
| 21 | class Responsive_Lightbox_Gallery_Paging extends Responsive_Lightbox_Gallery_Base { |
| 22 | |
| 23 | /** |
| 24 | * Tab key identifier. |
| 25 | * |
| 26 | * @var string |
| 27 | */ |
| 28 | const TAB_KEY = 'paging'; |
| 29 | |
| 30 | /** |
| 31 | * Get tab data for rendering. |
| 32 | * |
| 33 | * @param string $menu_item Optional menu item (unused for this tab). |
| 34 | * @return array Tab data. |
| 35 | */ |
| 36 | public function get_tab_data( $menu_item = '' ) { |
| 37 | return [ |
| 38 | 'tab_key' => self::TAB_KEY, |
| 39 | 'options' => [ |
| 40 | 'pagination' => [ |
| 41 | 'title' => __( 'Use Pagination', 'responsive-lightbox' ), |
| 42 | 'type' => 'boolean', |
| 43 | 'label' => __( 'Enable pagination.', 'responsive-lightbox' ), |
| 44 | 'default' => false, |
| 45 | 'description' => __( 'Enable pagination for this gallery.', 'responsive-lightbox' ) |
| 46 | ], |
| 47 | 'pagination_type' => [ |
| 48 | 'title' => __( 'Pagination Type', 'responsive-lightbox' ), |
| 49 | 'type' => 'select', |
| 50 | 'description' => __( 'Select pagination type.', 'responsive-lightbox' ), |
| 51 | 'default' => 'paged', |
| 52 | 'options' => [ |
| 53 | 'paged' => __( 'standard', 'responsive-lightbox' ), |
| 54 | 'ajax' => __( 'AJAX', 'responsive-lightbox' ), |
| 55 | 'infinite' => __( 'infinite scroll', 'responsive-lightbox' ) |
| 56 | ] |
| 57 | ], |
| 58 | 'pagination_position' => [ |
| 59 | 'title' => __( 'Pagination Position', 'responsive-lightbox' ), |
| 60 | 'type' => 'select', |
| 61 | 'description' => __( 'Select pagination position.', 'responsive-lightbox' ), |
| 62 | 'default' => 'bottom', |
| 63 | 'options' => [ |
| 64 | 'bottom' => __( 'bottom', 'responsive-lightbox' ), |
| 65 | 'top' => __( 'top', 'responsive-lightbox' ), |
| 66 | 'both' => __( 'top & bottom', 'responsive-lightbox' ) |
| 67 | ] |
| 68 | ], |
| 69 | 'images_per_page' => [ |
| 70 | 'title' => __( 'Images Per Page', 'responsive-lightbox' ), |
| 71 | 'type' => 'number', |
| 72 | 'description' => __( 'Number of images per page.', 'responsive-lightbox' ), |
| 73 | 'default' => get_option( 'posts_per_page', 20 ), |
| 74 | 'step' => 1, |
| 75 | 'min' => 0 |
| 76 | ], |
| 77 | 'load_more' => [ |
| 78 | 'title' => __( 'Load More', 'responsive-lightbox' ), |
| 79 | 'type' => 'radio', |
| 80 | 'description' => __( 'Select the load more trigger (infinite scroll only).', 'responsive-lightbox' ), |
| 81 | 'default' => 'automatically', |
| 82 | 'options' => [ |
| 83 | 'automatically' => __( 'Automatically', 'responsive-lightbox' ), |
| 84 | 'manually' => __( 'On click', 'responsive-lightbox' ) |
| 85 | ] |
| 86 | ] |
| 87 | ] |
| 88 | ]; |
| 89 | } |
| 90 | } |