class-gallery-api.php
4 months ago
class-gallery-base.php
3 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
3 months ago
trait-gallery-duplicate.php
4 months ago
trait-gallery-image-methods.php
3 months ago
trait-gallery-preview.php
4 months ago
trait-gallery-sanitize.php
4 months ago
class-gallery-design.php
155 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Responsive Lightbox Gallery Design Settings |
| 4 | * |
| 5 | * Handles gallery design 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_Design class. |
| 16 | * |
| 17 | * Gallery design tab - implements design settings. |
| 18 | * |
| 19 | * @class Responsive_Lightbox_Gallery_Design |
| 20 | */ |
| 21 | class Responsive_Lightbox_Gallery_Design extends Responsive_Lightbox_Gallery_Base { |
| 22 | |
| 23 | /** |
| 24 | * Tab key identifier. |
| 25 | * |
| 26 | * @var string |
| 27 | */ |
| 28 | const TAB_KEY = 'design'; |
| 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 | $rl = Responsive_Lightbox(); |
| 38 | |
| 39 | // merge titles |
| 40 | $merged_titles = array( 'global' => __( 'Global', 'responsive-lightbox' ) ) + $rl->settings->get_data( 'image_titles' ); |
| 41 | |
| 42 | return [ |
| 43 | 'tab_key' => self::TAB_KEY, |
| 44 | 'options' => [ |
| 45 | 'design_show_title' => [ |
| 46 | 'title' => __( 'Thumbnail Title', 'responsive-lightbox' ), |
| 47 | 'type' => 'select', |
| 48 | 'description' => __( 'Select title for the gallery thumbnails.', 'responsive-lightbox' ), |
| 49 | 'default' => 'global', |
| 50 | 'options' => $merged_titles |
| 51 | ], |
| 52 | 'design_show_caption' => [ |
| 53 | 'title' => __( 'Thumbnail Caption', 'responsive-lightbox' ), |
| 54 | 'type' => 'select', |
| 55 | 'description' => __( 'Select caption for the gallery thumbnails.', 'responsive-lightbox' ), |
| 56 | 'default' => 'global', |
| 57 | 'options' => $merged_titles |
| 58 | ], |
| 59 | 'show_icon' => [ |
| 60 | 'title' => __( 'Thumbnail Icon', 'responsive-lightbox' ), |
| 61 | 'type' => 'radio', |
| 62 | 'description' => __( 'Select icon for the gallery thumbnails.', 'responsive-lightbox' ), |
| 63 | 'default' => '0', |
| 64 | 'options' => [ |
| 65 | '0' => __( 'none', 'responsive-lightbox' ), |
| 66 | '1' => '', |
| 67 | '2' => '', |
| 68 | '3' => '', |
| 69 | '4' => '', |
| 70 | '5' => '', |
| 71 | '6' => '', |
| 72 | '7' => '', |
| 73 | '8' => '', |
| 74 | '9' => '', |
| 75 | '10' => '' |
| 76 | ] |
| 77 | ], |
| 78 | 'hover_effect' => [ |
| 79 | 'title' => __( 'Hover Effect', 'responsive-lightbox' ), |
| 80 | 'type' => 'select', |
| 81 | 'description' => __( 'Select thumbnail effect on hover.', 'responsive-lightbox' ), |
| 82 | 'default' => '0', |
| 83 | 'options' => [ |
| 84 | '0' => __( 'none', 'responsive-lightbox' ), |
| 85 | '1' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 1 ), |
| 86 | '2' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 2 ), |
| 87 | '3' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 3 ), |
| 88 | '4' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 4 ), |
| 89 | '5' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 5 ), |
| 90 | '6' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 6 ), |
| 91 | '7' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 7 ), |
| 92 | '8' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 8 ), |
| 93 | '9' => sprintf( __( 'Effect %s', 'responsive-lightbox' ), 9 ) |
| 94 | ] |
| 95 | ], |
| 96 | 'caption_font_size' => [ |
| 97 | 'title' => __( 'Caption Font Size', 'responsive-lightbox' ), |
| 98 | 'type' => 'number', |
| 99 | 'default' => 13, |
| 100 | 'step' => 1, |
| 101 | 'min' => 10, |
| 102 | 'max' => 20, |
| 103 | 'append' => 'px' |
| 104 | ], |
| 105 | 'caption_padding' => [ |
| 106 | 'title' => __( 'Caption Padding', 'responsive-lightbox' ), |
| 107 | 'type' => 'number', |
| 108 | 'default' => 20, |
| 109 | 'step' => 1, |
| 110 | 'min' => 5, |
| 111 | 'max' => 30, |
| 112 | 'append' => 'px' |
| 113 | ], |
| 114 | 'title_color' => [ |
| 115 | 'title' => __( 'Title Color', 'responsive-lightbox' ), |
| 116 | 'type' => 'color_picker', |
| 117 | 'default' => '#ffffff' |
| 118 | ], |
| 119 | 'caption_color' => [ |
| 120 | 'title' => __( 'Caption Color', 'responsive-lightbox' ), |
| 121 | 'type' => 'color_picker', |
| 122 | 'default' => '#cccccc' |
| 123 | ], |
| 124 | 'background_color' => [ |
| 125 | 'title' => __( 'Background Color', 'responsive-lightbox' ), |
| 126 | 'type' => 'color_picker', |
| 127 | 'default' => '#000000' |
| 128 | ], |
| 129 | 'background_opacity' => [ |
| 130 | 'title' => __( 'Background Opacity', 'responsive-lightbox' ), |
| 131 | 'type' => 'number', |
| 132 | 'default' => 80, |
| 133 | 'step' => 1, |
| 134 | 'min' => 0, |
| 135 | 'max' => 100, |
| 136 | 'append' => '%' |
| 137 | ], |
| 138 | 'border_color' => [ |
| 139 | 'title' => __( 'Border Color', 'responsive-lightbox' ), |
| 140 | 'type' => 'color_picker', |
| 141 | 'default' => '#000000' |
| 142 | ], |
| 143 | 'border_width' => [ |
| 144 | 'title' => __( 'Border Width', 'responsive-lightbox' ), |
| 145 | 'type' => 'number', |
| 146 | 'default' => 0, |
| 147 | 'step' => 1, |
| 148 | 'min' => 0, |
| 149 | 'max' => 100, |
| 150 | 'append' => 'px' |
| 151 | ] |
| 152 | ] |
| 153 | ]; |
| 154 | } |
| 155 | } |