galleries
1 week ago
providers
4 months ago
settings
4 months ago
class-fast-image.php
2 years ago
class-folders.php
1 week ago
class-frontend.php
1 week ago
class-galleries.php
4 months ago
class-multilang.php
2 years ago
class-remote-library-api.php
1 week ago
class-remote-library.php
1 week ago
class-settings-api.php
1 month ago
class-settings-data.php
5 months ago
class-settings-pages.php
4 months ago
class-settings.php
4 months ago
class-tour.php
5 months ago
class-welcome.php
4 months ago
class-widgets.php
2 years ago
functions.php
3 years ago
class-settings-data.php
247 lines
| 1 | <?php |
| 2 | // exit if accessed directly |
| 3 | if ( ! defined( 'ABSPATH' ) ) |
| 4 | exit; |
| 5 | |
| 6 | /** |
| 7 | * Responsive_Lightbox_Settings_Data class. |
| 8 | * |
| 9 | * Centralized static helper for settings data (scripts, image titles, etc.) |
| 10 | * Previously stored in class-settings.php arrays. |
| 11 | * |
| 12 | * @class Responsive_Lightbox_Settings_Data |
| 13 | * @since 2.6.1 |
| 14 | */ |
| 15 | class Responsive_Lightbox_Settings_Data { |
| 16 | |
| 17 | /** |
| 18 | * Get available lightbox scripts with metadata. |
| 19 | * |
| 20 | * @return array Scripts array with name, configurability, and reset fields. |
| 21 | */ |
| 22 | public static function get_scripts() { |
| 23 | $rl = Responsive_Lightbox(); |
| 24 | |
| 25 | return apply_filters( |
| 26 | 'rl_settings_scripts', |
| 27 | [ |
| 28 | 'glightbox' => [ |
| 29 | 'name' => __( 'GLightbox', 'responsive-lightbox' ), |
| 30 | 'configurability' => true, |
| 31 | 'supports' => [ 'title', 'caption', 'html_caption' ], |
| 32 | 'reset' => [ |
| 33 | 'skin' => 'clean', |
| 34 | 'width' => 900, |
| 35 | 'height' => 506, |
| 36 | 'effect' => 'fade', |
| 37 | 'slide_effect' => 'slide', |
| 38 | 'open_effect' => 'zoom', |
| 39 | 'close_effect' => 'zoom', |
| 40 | 'more_length' => 60, |
| 41 | 'more_text' => __( 'See more', 'responsive-lightbox' ), |
| 42 | 'more_toggle' => true, |
| 43 | 'loop_at_end' => false, |
| 44 | 'autoplay_videos' => true, |
| 45 | 'touchnavigation' => true, |
| 46 | 'touchFollowAxis' => true, |
| 47 | 'keyboardnavigation' => true, |
| 48 | 'close_on_click' => true, |
| 49 | 'drag_auto_snap' => false |
| 50 | ] |
| 51 | ], |
| 52 | 'swipebox' => [ |
| 53 | 'name' => __( 'SwipeBox', 'responsive-lightbox' ), |
| 54 | 'configurability' => true, |
| 55 | 'supports' => [ 'title' ], |
| 56 | 'animations' => [ |
| 57 | 'css' => __( 'CSS', 'responsive-lightbox' ), |
| 58 | 'jquery' => __( 'jQuery', 'responsive-lightbox' ) |
| 59 | ], |
| 60 | 'reset' => [ |
| 61 | 'animation' => 'css', |
| 62 | 'force_single_image' => false, |
| 63 | 'hide_bars' => true, |
| 64 | 'hide_bars_delay' => 5000, |
| 65 | 'video_max_width' => 1080 |
| 66 | ] |
| 67 | ], |
| 68 | 'prettyphoto' => [ |
| 69 | 'name' => __( 'prettyPhoto', 'responsive-lightbox' ), |
| 70 | 'configurability' => true, |
| 71 | 'supports' => [ 'inline', 'iframe', 'ajax', 'title', 'caption' ], |
| 72 | 'animation_speeds' => [ |
| 73 | 'fast' => __( 'fast', 'responsive-lightbox' ), |
| 74 | 'normal' => __( 'normal', 'responsive-lightbox' ), |
| 75 | 'slow' => __( 'slow', 'responsive-lightbox' ) |
| 76 | ], |
| 77 | 'themes' => [ |
| 78 | 'pp_default' => __( 'default', 'responsive-lightbox' ), |
| 79 | 'light_rounded' => __( 'light rounded', 'responsive-lightbox' ), |
| 80 | 'dark_rounded' => __( 'dark rounded', 'responsive-lightbox' ), |
| 81 | 'light_square' => __( 'light square', 'responsive-lightbox' ), |
| 82 | 'dark_square' => __( 'dark square', 'responsive-lightbox' ), |
| 83 | 'facebook' => __( 'facebook', 'responsive-lightbox' ) |
| 84 | ], |
| 85 | 'wmodes' => [ |
| 86 | 'opaque' => __( 'opaque', 'responsive-lightbox' ), |
| 87 | 'transparent' => __( 'transparent', 'responsive-lightbox' ), |
| 88 | 'window' => __( 'window', 'responsive-lightbox' ), |
| 89 | 'direct' => __( 'direct', 'responsive-lightbox' ) |
| 90 | ], |
| 91 | 'reset' => [ |
| 92 | 'animation_speed' => 'normal', |
| 93 | 'slideshow' => false, |
| 94 | 'slideshow_delay' => 5000, |
| 95 | 'slideshow_autoplay' => false, |
| 96 | 'opacity' => 75, |
| 97 | 'show_title' => true, |
| 98 | 'allow_resize' => true, |
| 99 | 'allow_expand' => true, |
| 100 | 'width' => 1080, |
| 101 | 'height' => 720, |
| 102 | 'separator' => '/', |
| 103 | 'theme' => 'pp_default', |
| 104 | 'horizontal_padding' => 20, |
| 105 | 'hide_flash' => false, |
| 106 | 'wmode' => 'opaque', |
| 107 | 'video_autoplay' => false, |
| 108 | 'modal' => false, |
| 109 | 'deeplinking' => false, |
| 110 | 'overlay_gallery' => true, |
| 111 | 'keyboard_shortcuts' => true, |
| 112 | 'social' => false |
| 113 | ] |
| 114 | ], |
| 115 | 'nivo' => [ |
| 116 | 'name' => __( 'Nivo Lightbox', 'responsive-lightbox' ), |
| 117 | 'configurability' => true, |
| 118 | 'supports' => [ 'inline', 'iframe', 'ajax', 'title' ], |
| 119 | 'effects' => [ |
| 120 | 'fade' => 'fade', |
| 121 | 'fadeScale' => 'fadeScale', |
| 122 | 'slideLeft' => 'slideLeft', |
| 123 | 'slideRight' => 'slideRight', |
| 124 | 'slideUp' => 'slideUp', |
| 125 | 'slideDown' => 'slideDown', |
| 126 | 'fall' => 'fall' |
| 127 | ], |
| 128 | 'reset' => [ |
| 129 | 'effect' => 'fade', |
| 130 | 'click_overlay_to_close' => true, |
| 131 | 'keyboard_nav' => true, |
| 132 | 'error_message' => __( 'The requested content cannot be loaded. Please try again later.', 'responsive-lightbox' ) |
| 133 | ] |
| 134 | ], |
| 135 | 'imagelightbox' => [ |
| 136 | 'name' => __( 'Image Lightbox', 'responsive-lightbox' ), |
| 137 | 'configurability' => true, |
| 138 | 'supports' => [], |
| 139 | 'reset' => [ |
| 140 | 'animation_speed' => 250, |
| 141 | 'preload_next' => true, |
| 142 | 'enable_keyboard' => true, |
| 143 | 'quit_on_end' => false, |
| 144 | 'quit_on_image_click' => false, |
| 145 | 'quit_on_document_click' => true |
| 146 | ] |
| 147 | ], |
| 148 | 'tosrus' => [ |
| 149 | 'name' => __( 'TosRUs', 'responsive-lightbox' ), |
| 150 | 'configurability' => true, |
| 151 | 'supports' => [ 'inline', 'title' ], |
| 152 | 'reset' => [ |
| 153 | 'effect' => 'slide', |
| 154 | 'infinite' => true, |
| 155 | 'keys' => true, |
| 156 | 'autoplay' => true, |
| 157 | 'pause_on_hover' => true, |
| 158 | 'timeout' => 4000, |
| 159 | 'pagination' => true, |
| 160 | 'pagination_type' => 'thumbnails', |
| 161 | 'close_on_click' => false |
| 162 | ] |
| 163 | ], |
| 164 | 'featherlight' => [ |
| 165 | 'name' => __( 'Featherlight', 'responsive-lightbox' ), |
| 166 | 'configurability' => true, |
| 167 | 'supports' => [ 'inline', 'iframe', 'ajax' ], |
| 168 | 'reset' => [ |
| 169 | 'open_speed' => 250, |
| 170 | 'close_speed' => 250, |
| 171 | 'close_on_click' => 'background', |
| 172 | 'close_on_esc' => true, |
| 173 | 'gallery_fade_in' => 100, |
| 174 | 'gallery_fade_out' => 300, |
| 175 | 'iframe' => true, |
| 176 | 'iframe_width' => 1080, |
| 177 | 'iframe_height' => 720 |
| 178 | ] |
| 179 | ], |
| 180 | 'magnific' => [ |
| 181 | 'name' => __( 'Magnific Popup', 'responsive-lightbox' ), |
| 182 | 'configurability' => true, |
| 183 | 'supports' => [ 'inline', 'iframe', 'ajax', 'title', 'caption' ], |
| 184 | 'reset' => [ |
| 185 | 'disable_on' => 0, |
| 186 | 'close_on_content_click' => false, |
| 187 | 'close_on_background_click' => true, |
| 188 | 'show_close_button' => true, |
| 189 | 'enable_escape_key' => true, |
| 190 | 'align_top' => false, |
| 191 | 'fixed_content_pos' => 'auto', |
| 192 | 'fixed_background_pos' => false, |
| 193 | 'preloader' => true, |
| 194 | 'type' => 'image', |
| 195 | 'gallery' => true, |
| 196 | 'arrow_markup' => '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', |
| 197 | 'close_markup' => '<button title="%title%" type="button" class="mfp-close">×</button>', |
| 198 | 'image_markup' => '<div class="mfp-figure"><div class="mfp-close"></div><div class="mfp-img"></div><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></div>', |
| 199 | 'iframe_markup' => '<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe></div>', |
| 200 | 'main_class' => '', |
| 201 | 'iframe_patterns' => 'default', |
| 202 | 'video_autoplay' => false, |
| 203 | 'loop' => false, |
| 204 | 'animation_effect' => 'zoom', |
| 205 | 'zoom_duration' => 500, |
| 206 | 'zoom_easing' => 'ease-in-out', |
| 207 | 'zoom_opacity' => false |
| 208 | ] |
| 209 | ] |
| 210 | ] |
| 211 | ); |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * Get image title options. |
| 216 | * |
| 217 | * @return array Image title options array. |
| 218 | */ |
| 219 | public static function get_image_titles() { |
| 220 | return [ |
| 221 | '' => __( 'None', 'responsive-lightbox' ), |
| 222 | 'default' => __( 'Attachment Title', 'responsive-lightbox' ), |
| 223 | 'title' => __( 'Image Title', 'responsive-lightbox' ), |
| 224 | 'caption' => __( 'Image Caption', 'responsive-lightbox' ), |
| 225 | 'alt' => __( 'Image Alt Text', 'responsive-lightbox' ), |
| 226 | 'description' => __( 'Image Description', 'responsive-lightbox' ) |
| 227 | ]; |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * Get image size options. |
| 232 | * |
| 233 | * @return array Image size options array. |
| 234 | */ |
| 235 | public static function get_image_sizes() { |
| 236 | return apply_filters( |
| 237 | 'rl_settings_image_sizes', |
| 238 | [ |
| 239 | 'full' => __( 'Full Size (default)', 'responsive-lightbox' ), |
| 240 | 'large' => __( 'Large', 'responsive-lightbox' ), |
| 241 | 'medium' => __( 'Medium', 'responsive-lightbox' ), |
| 242 | 'thumbnail' => __( 'Thumbnail', 'responsive-lightbox' ) |
| 243 | ] |
| 244 | ); |
| 245 | } |
| 246 | } |
| 247 |