dep
2 years ago
premium-banner.php
2 years ago
premium-blog.php
2 years ago
premium-button.php
2 years ago
premium-carousel.php
2 years ago
premium-contactform.php
2 years ago
premium-countdown.php
2 years ago
premium-counter.php
2 years ago
premium-dual-header.php
2 years ago
premium-fancytext.php
2 years ago
premium-grid.php
2 years ago
premium-icon-list.php
2 years ago
premium-image-button.php
2 years ago
premium-image-scroll.php
2 years ago
premium-image-separator.php
2 years ago
premium-lottie.php
2 years ago
premium-maps.php
2 years ago
premium-media-wheel.php
2 years ago
premium-modalbox.php
2 years ago
premium-nav-menu.php
2 years ago
premium-notifications.php
2 years ago
premium-person.php
2 years ago
premium-pinterest-feed.php
2 years ago
premium-post-ticker.php
2 years ago
premium-pricing-table.php
2 years ago
premium-progressbar.php
2 years ago
premium-svg-drawer.php
2 years ago
premium-tcloud.php
2 years ago
premium-testimonials.php
2 years ago
premium-tiktok-feed.php
2 years ago
premium-title.php
2 years ago
premium-videobox.php
2 years ago
premium-vscroll.php
2 years ago
premium-weather.php
2 years ago
premium-world-clock.php
2 years ago
premium-grid.php
3443 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Premium Media Grid. |
| 4 | */ |
| 5 | |
| 6 | namespace PremiumAddons\Widgets; |
| 7 | |
| 8 | // Elementor Classes. |
| 9 | use Elementor\Modules\DynamicTags\Module as TagsModule; |
| 10 | use Elementor\Widget_Base; |
| 11 | use Elementor\Utils; |
| 12 | use Elementor\Embed; |
| 13 | use Elementor\Control_Media; |
| 14 | use Elementor\Controls_Manager; |
| 15 | use Elementor\Icons_Manager; |
| 16 | use Elementor\Repeater; |
| 17 | use Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 18 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 19 | use Elementor\Group_Control_Border; |
| 20 | use Elementor\Group_Control_Typography; |
| 21 | use Elementor\Group_Control_Css_Filter; |
| 22 | use Elementor\Group_Control_Text_Shadow; |
| 23 | use Elementor\Group_Control_Box_Shadow; |
| 24 | use Elementor\Group_Control_Background; |
| 25 | use Elementor\Group_Control_Image_Size; |
| 26 | |
| 27 | // PremiumAddons Classes. |
| 28 | use PremiumAddons\Includes\Helper_Functions; |
| 29 | use PremiumAddons\Includes\Premium_Template_Tags; |
| 30 | |
| 31 | if ( ! defined( 'ABSPATH' ) ) { |
| 32 | exit; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Class Premium_Grid |
| 37 | */ |
| 38 | class Premium_Grid extends Widget_Base { |
| 39 | |
| 40 | /** |
| 41 | * Template Instance |
| 42 | * |
| 43 | * @var template_instance |
| 44 | */ |
| 45 | protected $template_instance; |
| 46 | |
| 47 | /** |
| 48 | * Check for Self Hosted Videos |
| 49 | * |
| 50 | * @var is_self_hosted |
| 51 | */ |
| 52 | private static $check_self_hosted = false; |
| 53 | |
| 54 | /** |
| 55 | * Retrieve Widget Name. |
| 56 | * |
| 57 | * @since 1.0.0 |
| 58 | * @access public |
| 59 | */ |
| 60 | public function get_name() { |
| 61 | return 'premium-img-gallery'; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Get Elementor Helper Instance. |
| 66 | * |
| 67 | * @since 1.0.0 |
| 68 | * @access public |
| 69 | */ |
| 70 | public function getTemplateInstance() { |
| 71 | return $this->template_instance = Premium_Template_Tags::getInstance(); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Retrieve Widget Title. |
| 76 | * |
| 77 | * @since 1.0.0 |
| 78 | * @access public |
| 79 | */ |
| 80 | public function get_title() { |
| 81 | return __( 'Media Grid', 'premium-addons-for-elementor' ); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Retrieve Widget Icon. |
| 86 | * |
| 87 | * @since 1.0.0 |
| 88 | * @access public |
| 89 | * |
| 90 | * @return string widget icon. |
| 91 | */ |
| 92 | public function get_icon() { |
| 93 | return 'pa-grid-icon'; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Retrieve Widget Dependent CSS. |
| 98 | * |
| 99 | * @since 1.0.0 |
| 100 | * @access public |
| 101 | * |
| 102 | * @return array CSS style handles. |
| 103 | */ |
| 104 | public function get_style_depends() { |
| 105 | return array( |
| 106 | 'pa-prettyphoto', |
| 107 | 'premium-addons', |
| 108 | ); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Retrieve Widget Dependent JS. |
| 113 | * |
| 114 | * @since 1.0.0 |
| 115 | * @access public |
| 116 | * |
| 117 | * @return array JS script handles. |
| 118 | */ |
| 119 | public function get_script_depends() { |
| 120 | return array( |
| 121 | 'imagesloaded', |
| 122 | 'prettyPhoto-js', |
| 123 | 'isotope-js', |
| 124 | 'premium-addons', |
| 125 | ); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Widget preview refresh button. |
| 130 | * |
| 131 | * @since 1.0.0 |
| 132 | * @access public |
| 133 | */ |
| 134 | public function is_reload_preview_required() { |
| 135 | return true; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Retrieve Widget Categories. |
| 140 | * |
| 141 | * @since 1.5.1 |
| 142 | * @access public |
| 143 | * |
| 144 | * @return array Widget categories. |
| 145 | */ |
| 146 | public function get_categories() { |
| 147 | return array( 'premium-elements' ); |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Retrieve Widget Keywords. |
| 152 | * |
| 153 | * @since 1.0.0 |
| 154 | * @access public |
| 155 | * |
| 156 | * @return string Widget keywords. |
| 157 | */ |
| 158 | public function get_keywords() { |
| 159 | return array( 'pa', 'premium', 'layout', 'gallery', 'image', 'video', 'portfolio', 'visual', 'masonry', 'youtube', 'vimeo' ); |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Retrieve Widget Support URL. |
| 164 | * |
| 165 | * @access public |
| 166 | * |
| 167 | * @return string support URL. |
| 168 | */ |
| 169 | public function get_custom_help_url() { |
| 170 | return 'https://premiumaddons.com/support/'; |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * Register Media Grid controls. |
| 175 | * |
| 176 | * @since 2.1.0 |
| 177 | * @access protected |
| 178 | */ |
| 179 | protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
| 180 | |
| 181 | $this->start_controls_section( |
| 182 | 'premium_gallery_general', |
| 183 | array( |
| 184 | 'label' => __( 'Layout', 'premium-addons-for-elementor' ), |
| 185 | |
| 186 | ) |
| 187 | ); |
| 188 | |
| 189 | $this->add_control( |
| 190 | 'premium_gallery_img_size_select', |
| 191 | array( |
| 192 | 'label' => __( 'Grid Layout', 'premium-addons-for-elementor' ), |
| 193 | 'type' => Controls_Manager::SELECT, |
| 194 | 'options' => array( |
| 195 | 'fitRows' => __( 'Even', 'premium-addons-for-elementor' ), |
| 196 | 'masonry' => __( 'Masonry', 'premium-addons-for-elementor' ), |
| 197 | 'metro' => __( 'Metro', 'premium-addons-for-elementor' ), |
| 198 | ), |
| 199 | 'default' => 'fitRows', |
| 200 | ) |
| 201 | ); |
| 202 | |
| 203 | $this->add_responsive_control( |
| 204 | 'pemium_gallery_even_img_height', |
| 205 | array( |
| 206 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 207 | 'label_block' => true, |
| 208 | 'size_units' => array( 'px', 'em', 'vh' ), |
| 209 | 'type' => Controls_Manager::SLIDER, |
| 210 | 'range' => array( |
| 211 | 'px' => array( |
| 212 | 'min' => 1, |
| 213 | 'max' => 500, |
| 214 | ), |
| 215 | 'em' => array( |
| 216 | 'min' => 1, |
| 217 | 'max' => 50, |
| 218 | ), |
| 219 | ), |
| 220 | 'render_type' => 'template', |
| 221 | 'condition' => array( |
| 222 | 'premium_gallery_img_size_select' => 'fitRows', |
| 223 | ), |
| 224 | 'selectors' => array( |
| 225 | '{{WRAPPER}} .pa-gallery-img-container img' => 'height: {{SIZE}}{{UNIT}}', |
| 226 | ), |
| 227 | ) |
| 228 | ); |
| 229 | |
| 230 | $this->add_control( |
| 231 | 'premium_gallery_images_fit', |
| 232 | array( |
| 233 | 'label' => __( 'Images Fit', 'premium-addons-for-elementor' ), |
| 234 | 'type' => Controls_Manager::SELECT, |
| 235 | 'options' => array( |
| 236 | 'fill' => __( 'Fill', 'premium-addons-for-elementor' ), |
| 237 | 'cover' => __( 'Cover', 'premium-addons-for-elementor' ), |
| 238 | ), |
| 239 | 'default' => 'fill', |
| 240 | 'selectors' => array( |
| 241 | '{{WRAPPER}} .pa-gallery-img-container img' => 'object-fit: {{VALUE}}', |
| 242 | ), |
| 243 | 'condition' => array( |
| 244 | 'premium_gallery_img_size_select' => array( 'metro', 'fitRows' ), |
| 245 | ), |
| 246 | ) |
| 247 | ); |
| 248 | |
| 249 | $this->add_group_control( |
| 250 | Group_Control_Image_Size::get_type(), |
| 251 | array( |
| 252 | 'name' => 'thumbnail', |
| 253 | 'default' => 'full', |
| 254 | ) |
| 255 | ); |
| 256 | |
| 257 | $this->add_responsive_control( |
| 258 | 'premium_gallery_column_number', |
| 259 | array( |
| 260 | 'label' => __( 'Columns', 'premium-addons-for-elementor' ), |
| 261 | 'label_block' => true, |
| 262 | 'type' => Controls_Manager::SELECT, |
| 263 | 'desktop_default' => '50%', |
| 264 | 'tablet_default' => '100%', |
| 265 | 'mobile_default' => '100%', |
| 266 | 'options' => array( |
| 267 | '100%' => __( '1 Column', 'premium-addons-for-elementor' ), |
| 268 | '50%' => __( '2 Columns', 'premium-addons-for-elementor' ), |
| 269 | '33.330%' => __( '3 Columns', 'premium-addons-for-elementor' ), |
| 270 | '25%' => __( '4 Columns', 'premium-addons-for-elementor' ), |
| 271 | '20%' => __( '5 Columns', 'premium-addons-for-elementor' ), |
| 272 | '16.66%' => __( '6 Columns', 'premium-addons-for-elementor' ), |
| 273 | '8.33%' => __( '12 Columns', 'premium-addons-for-elementor' ), |
| 274 | ), |
| 275 | 'condition' => array( |
| 276 | 'premium_gallery_img_size_select!' => 'metro', |
| 277 | ), |
| 278 | 'selectors' => array( |
| 279 | '{{WRAPPER}} .premium-img-gallery-masonry div.premium-gallery-item, {{WRAPPER}} .premium-img-gallery-fitRows div.premium-gallery-item' => 'width: {{VALUE}};', |
| 280 | ), |
| 281 | 'render_type' => 'template', |
| 282 | ) |
| 283 | ); |
| 284 | |
| 285 | $this->add_control( |
| 286 | 'premium_gallery_load_more', |
| 287 | array( |
| 288 | 'label' => __( 'Load More Button', 'premium-addons-for-elementor' ), |
| 289 | 'description' => __( 'Requires number of images larger than 6', 'premium-addons-for-elementor' ), |
| 290 | 'type' => Controls_Manager::SWITCHER, |
| 291 | 'condition' => array( |
| 292 | 'premium_gallery_shuffle_onload!' => 'yes', |
| 293 | ), |
| 294 | ) |
| 295 | ); |
| 296 | |
| 297 | $this->add_control( |
| 298 | 'premium_gallery_load_more_text', |
| 299 | array( |
| 300 | 'label' => __( 'Button Text', 'premium-addons-for-elementor' ), |
| 301 | 'type' => Controls_Manager::TEXT, |
| 302 | 'default' => __( 'Load More', 'premium-addons-for-elementor' ), |
| 303 | 'dynamic' => array( 'active' => true ), |
| 304 | 'condition' => array( |
| 305 | 'premium_gallery_load_more' => 'yes', |
| 306 | ), |
| 307 | ) |
| 308 | ); |
| 309 | |
| 310 | $this->add_control( |
| 311 | 'premium_gallery_load_minimum', |
| 312 | array( |
| 313 | 'label' => __( 'Initial Number of Images', 'premium-addons-for-elementor' ), |
| 314 | 'type' => Controls_Manager::NUMBER, |
| 315 | 'description' => __( 'Set the minimum number of images before showing load more button', 'premium-addons-for-elementor' ), |
| 316 | 'default' => 6, |
| 317 | 'condition' => array( |
| 318 | 'premium_gallery_load_more' => 'yes', |
| 319 | ), |
| 320 | ) |
| 321 | ); |
| 322 | |
| 323 | $this->add_control( |
| 324 | 'premium_gallery_load_click_number', |
| 325 | array( |
| 326 | 'label' => __( 'Images to Show', 'premium-addons-for-elementor' ), |
| 327 | 'type' => Controls_Manager::NUMBER, |
| 328 | 'description' => __( 'Set the minimum number of images to show with each click', 'premium-addons-for-elementor' ), |
| 329 | 'default' => 6, |
| 330 | 'condition' => array( |
| 331 | 'premium_gallery_load_more' => 'yes', |
| 332 | ), |
| 333 | ) |
| 334 | ); |
| 335 | |
| 336 | $this->add_responsive_control( |
| 337 | 'premium_gallery_load_more_align', |
| 338 | array( |
| 339 | 'label' => __( 'Button Alignment', 'premium-addons-for-elementor' ), |
| 340 | 'type' => Controls_Manager::CHOOSE, |
| 341 | 'options' => array( |
| 342 | 'left' => array( |
| 343 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 344 | 'icon' => 'eicon-text-align-left', |
| 345 | ), |
| 346 | 'center' => array( |
| 347 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 348 | 'icon' => 'eicon-text-align-center', |
| 349 | ), |
| 350 | 'right' => array( |
| 351 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 352 | 'icon' => 'eicon-text-align-right', |
| 353 | ), |
| 354 | ), |
| 355 | 'default' => 'center', |
| 356 | 'selectors' => array( |
| 357 | '{{WRAPPER}} .premium-gallery-load-more' => 'text-align: {{VALUE}};', |
| 358 | ), |
| 359 | 'condition' => array( |
| 360 | 'premium_gallery_load_more' => 'yes', |
| 361 | ), |
| 362 | ) |
| 363 | ); |
| 364 | |
| 365 | $this->add_control( |
| 366 | 'gradient_layer', |
| 367 | array( |
| 368 | 'label' => __( 'Gradient Layer', 'premium-addons-for-elementor' ), |
| 369 | 'description' => __( 'Adds a gradient color on top of the grid container', 'premium-addons-for-elementor' ), |
| 370 | 'type' => Controls_Manager::SWITCHER, |
| 371 | 'condition' => array( |
| 372 | 'premium_gallery_load_more' => 'yes', |
| 373 | ), |
| 374 | ) |
| 375 | ); |
| 376 | |
| 377 | $this->add_group_control( |
| 378 | Group_Control_Background::get_type(), |
| 379 | array( |
| 380 | 'name' => 'gradient_color', |
| 381 | 'types' => array( 'gradient' ), |
| 382 | 'selector' => '{{WRAPPER}} .premium-gallery-gradient-layer', |
| 383 | 'condition' => array( |
| 384 | 'premium_gallery_load_more' => 'yes', |
| 385 | 'gradient_layer' => 'yes', |
| 386 | ), |
| 387 | ) |
| 388 | ); |
| 389 | |
| 390 | $this->add_responsive_control( |
| 391 | 'gradient_height', |
| 392 | array( |
| 393 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 394 | 'label_block' => true, |
| 395 | 'size_units' => array( 'px', 'em', '%', 'custom' ), |
| 396 | 'type' => Controls_Manager::SLIDER, |
| 397 | 'range' => array( |
| 398 | 'px' => array( |
| 399 | 'min' => 1, |
| 400 | 'max' => 300, |
| 401 | ), |
| 402 | 'em' => array( |
| 403 | 'min' => 1, |
| 404 | 'max' => 30, |
| 405 | ), |
| 406 | ), |
| 407 | 'condition' => array( |
| 408 | 'premium_gallery_load_more' => 'yes', |
| 409 | 'gradient_layer' => 'yes', |
| 410 | ), |
| 411 | 'selectors' => array( |
| 412 | '{{WRAPPER}} .premium-gallery-gradient-layer' => 'height: {{SIZE}}{{UNIT}}', |
| 413 | ), |
| 414 | ) |
| 415 | ); |
| 416 | |
| 417 | $this->add_responsive_control( |
| 418 | 'gradient_position', |
| 419 | array( |
| 420 | 'label' => __( 'Position', 'premium-addons-for-elementor' ), |
| 421 | 'label_block' => true, |
| 422 | 'size_units' => array( 'px', 'em', '%', 'custom' ), |
| 423 | 'type' => Controls_Manager::SLIDER, |
| 424 | 'condition' => array( |
| 425 | 'premium_gallery_load_more' => 'yes', |
| 426 | 'gradient_layer' => 'yes', |
| 427 | ), |
| 428 | 'selectors' => array( |
| 429 | '{{WRAPPER}} .premium-gallery-gradient-layer' => 'bottom: {{SIZE}}{{UNIT}}', |
| 430 | ), |
| 431 | ) |
| 432 | ); |
| 433 | |
| 434 | $this->end_controls_section(); |
| 435 | |
| 436 | $this->start_controls_section( |
| 437 | 'premium_gallery_cats', |
| 438 | array( |
| 439 | 'label' => __( 'Categories', 'premium-addons-for-elementor' ), |
| 440 | ) |
| 441 | ); |
| 442 | |
| 443 | $this->add_control( |
| 444 | 'premium_gallery_filter', |
| 445 | array( |
| 446 | 'label' => __( 'Filter Tabs', 'premium-addons-for-elementor' ), |
| 447 | 'type' => Controls_Manager::SWITCHER, |
| 448 | 'default' => 'yes', |
| 449 | ) |
| 450 | ); |
| 451 | |
| 452 | $condition = array( 'premium_gallery_filter' => 'yes' ); |
| 453 | |
| 454 | $this->add_control( |
| 455 | 'premium_gallery_first_cat_switcher', |
| 456 | array( |
| 457 | 'label' => __( 'First Category', 'premium-addons-for-elementor' ), |
| 458 | 'type' => Controls_Manager::SWITCHER, |
| 459 | 'default' => 'yes', |
| 460 | 'condition' => $condition, |
| 461 | ) |
| 462 | ); |
| 463 | |
| 464 | $this->add_control( |
| 465 | 'premium_gallery_first_cat_label', |
| 466 | array( |
| 467 | 'label' => __( 'First Category Label', 'premium-addons-for-elementor' ), |
| 468 | 'type' => Controls_Manager::TEXT, |
| 469 | 'default' => __( 'All', 'premium-addons-for-elementor' ), |
| 470 | 'dynamic' => array( 'active' => true ), |
| 471 | 'condition' => array_merge( |
| 472 | array( |
| 473 | 'premium_gallery_first_cat_switcher' => 'yes', |
| 474 | ), |
| 475 | $condition |
| 476 | ), |
| 477 | ) |
| 478 | ); |
| 479 | |
| 480 | $repeater = new REPEATER(); |
| 481 | |
| 482 | $repeater->add_control( |
| 483 | 'premium_gallery_img_cat', |
| 484 | array( |
| 485 | 'label' => __( 'Category', 'premium-addons-for-elementor' ), |
| 486 | 'type' => Controls_Manager::TEXT, |
| 487 | 'dynamic' => array( 'active' => true ), |
| 488 | ) |
| 489 | ); |
| 490 | |
| 491 | $repeater->add_control( |
| 492 | 'premium_gallery_img_cat_rotation', |
| 493 | array( |
| 494 | 'label' => __( 'Rotation Degrees', 'premium-addons-for-elementor' ), |
| 495 | 'type' => Controls_Manager::NUMBER, |
| 496 | 'description' => __( 'Set rotation value in degrees', 'premium-addons-for-elementor' ), |
| 497 | 'min' => -180, |
| 498 | 'max' => 180, |
| 499 | 'selectors' => array( |
| 500 | '{{WRAPPER}} {{CURRENT_ITEM}}' => 'transform: rotate({{VALUE}}deg);', |
| 501 | ), |
| 502 | ) |
| 503 | ); |
| 504 | |
| 505 | $this->add_control( |
| 506 | 'premium_gallery_cats_content', |
| 507 | array( |
| 508 | 'label' => __( 'Categories', 'premium-addons-for-elementor' ), |
| 509 | 'type' => Controls_Manager::REPEATER, |
| 510 | 'default' => array( |
| 511 | array( |
| 512 | 'premium_gallery_img_cat' => 'Category 1', |
| 513 | ), |
| 514 | array( |
| 515 | 'premium_gallery_img_cat' => 'Category 2', |
| 516 | ), |
| 517 | ), |
| 518 | 'fields' => $repeater->get_controls(), |
| 519 | 'title_field' => '{{{ premium_gallery_img_cat }}}', |
| 520 | 'condition' => $condition, |
| 521 | ) |
| 522 | ); |
| 523 | |
| 524 | $this->add_control( |
| 525 | 'premium_gallery_active_cat', |
| 526 | array( |
| 527 | 'label' => __( 'Active Category Index', 'premium-addons-for-elementor' ), |
| 528 | 'type' => Controls_Manager::NUMBER, |
| 529 | 'default' => 0, |
| 530 | 'min' => 0, |
| 531 | 'condition' => $condition, |
| 532 | |
| 533 | ) |
| 534 | ); |
| 535 | |
| 536 | $this->add_control( |
| 537 | 'active_cat_notice', |
| 538 | array( |
| 539 | 'raw' => __( 'Please note categories are zero indexed, so if you need the first category to be active, you need to set the value to 0', 'premium-addons-for-elementor' ), |
| 540 | 'type' => Controls_Manager::RAW_HTML, |
| 541 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 542 | 'condition' => $condition, |
| 543 | ) |
| 544 | ); |
| 545 | |
| 546 | $this->add_control( |
| 547 | 'premium_gallery_shuffle', |
| 548 | array( |
| 549 | 'label' => __( 'Shuffle Images on Filter Click', 'premium-addons-for-elementor' ), |
| 550 | 'type' => Controls_Manager::SWITCHER, |
| 551 | 'condition' => array_merge( |
| 552 | array( |
| 553 | 'premium_gallery_filter' => 'yes', |
| 554 | ), |
| 555 | $condition |
| 556 | ), |
| 557 | ) |
| 558 | ); |
| 559 | |
| 560 | $this->add_responsive_control( |
| 561 | 'premium_gallery_filters_align', |
| 562 | array( |
| 563 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 564 | 'type' => Controls_Manager::CHOOSE, |
| 565 | 'options' => array( |
| 566 | 'flex-start' => array( |
| 567 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 568 | 'icon' => 'eicon-text-align-left', |
| 569 | ), |
| 570 | 'center' => array( |
| 571 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 572 | 'icon' => 'eicon-text-align-center', |
| 573 | ), |
| 574 | 'flex-end' => array( |
| 575 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 576 | 'icon' => 'eicon-text-align-right', |
| 577 | ), |
| 578 | ), |
| 579 | 'default' => 'center', |
| 580 | 'selectors' => array( |
| 581 | '{{WRAPPER}} .premium-img-gallery-filter' => 'justify-content: {{VALUE}}', |
| 582 | ), |
| 583 | 'condition' => $condition, |
| 584 | ) |
| 585 | ); |
| 586 | |
| 587 | $this->add_control( |
| 588 | 'url_flag', |
| 589 | array( |
| 590 | 'label' => __( 'URL Flag', 'premium-addons-for-elementor' ), |
| 591 | 'type' => Controls_Manager::TEXT, |
| 592 | 'default' => 'cat', |
| 593 | 'description' => __( 'This is used to link categories from different pages. For example: premiumaddons.com/grid-widget-for-elementor-page-builder?cat=2', 'premium-addons-for-elementor' ), |
| 594 | 'label_block' => true, |
| 595 | 'condition' => $condition, |
| 596 | ) |
| 597 | ); |
| 598 | |
| 599 | $this->end_controls_section(); |
| 600 | |
| 601 | $this->start_controls_section( |
| 602 | 'premium_gallery_content', |
| 603 | array( |
| 604 | 'label' => __( 'Images/Videos', 'premium-addons-for-elementor' ), |
| 605 | ) |
| 606 | ); |
| 607 | |
| 608 | $img_repeater = new REPEATER(); |
| 609 | |
| 610 | $img_repeater->add_control( |
| 611 | 'premium_gallery_img', |
| 612 | array( |
| 613 | 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ), |
| 614 | 'type' => Controls_Manager::MEDIA, |
| 615 | 'dynamic' => array( 'active' => true ), |
| 616 | 'default' => array( |
| 617 | 'url' => Utils::get_placeholder_image_src(), |
| 618 | ), |
| 619 | ) |
| 620 | ); |
| 621 | |
| 622 | $img_repeater->add_responsive_control( |
| 623 | 'premium_gallery_image_cell', |
| 624 | array( |
| 625 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 626 | 'description' => __( 'Works only when layout set to Metro', 'premium-addons-for-elementor' ), |
| 627 | 'label_block' => true, |
| 628 | 'default' => array( |
| 629 | 'unit' => 'px', |
| 630 | 'size' => 4, |
| 631 | ), |
| 632 | 'type' => Controls_Manager::SLIDER, |
| 633 | 'range' => array( |
| 634 | 'px' => array( |
| 635 | 'min' => 1, |
| 636 | 'max' => 12, |
| 637 | ), |
| 638 | ), |
| 639 | 'render_type' => 'template', |
| 640 | 'frontend_available' => true, |
| 641 | ) |
| 642 | ); |
| 643 | |
| 644 | $img_repeater->add_responsive_control( |
| 645 | 'premium_gallery_image_vcell', |
| 646 | array( |
| 647 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 648 | 'description' => __( 'Works only when layout set to \'Metro\'', 'premium-addons-for-elementor' ), |
| 649 | 'label_block' => true, |
| 650 | 'type' => Controls_Manager::SLIDER, |
| 651 | 'default' => array( |
| 652 | 'unit' => 'px', |
| 653 | 'size' => 4, |
| 654 | ), |
| 655 | 'range' => array( |
| 656 | 'px' => array( |
| 657 | 'min' => 1, |
| 658 | 'max' => 12, |
| 659 | ), |
| 660 | ), |
| 661 | 'render_type' => 'template', |
| 662 | 'frontend_available' => true, |
| 663 | ) |
| 664 | ); |
| 665 | |
| 666 | $img_repeater->add_control( |
| 667 | 'premium_gallery_video', |
| 668 | array( |
| 669 | 'label' => __( 'Video', 'premium-addons-for-elementor' ), |
| 670 | 'type' => Controls_Manager::SWITCHER, |
| 671 | 'return_value' => 'true', |
| 672 | ) |
| 673 | ); |
| 674 | |
| 675 | $img_repeater->add_control( |
| 676 | 'premium_gallery_video_type', |
| 677 | array( |
| 678 | 'label' => __( 'Type', 'premium-addons-for-elementor' ), |
| 679 | 'type' => Controls_Manager::SELECT, |
| 680 | 'options' => array( |
| 681 | 'youtube' => __( 'YouTube', 'premium-addons-for-elementor' ), |
| 682 | 'vimeo' => __( 'Vimeo', 'premium-addons-for-elementor' ), |
| 683 | 'hosted' => __( 'Self Hosted', 'premium-addons-for-elementor' ), |
| 684 | ), |
| 685 | 'label_block' => true, |
| 686 | 'default' => 'youtube', |
| 687 | 'condition' => array( |
| 688 | 'premium_gallery_video' => 'true', |
| 689 | ), |
| 690 | ) |
| 691 | ); |
| 692 | |
| 693 | $img_repeater->add_control( |
| 694 | 'premium_gallery_video_url', |
| 695 | array( |
| 696 | 'label' => __( 'Video URL', 'premium-addons-for-elementor' ), |
| 697 | 'type' => Controls_Manager::TEXT, |
| 698 | 'label_block' => true, |
| 699 | 'dynamic' => array( |
| 700 | 'active' => true, |
| 701 | 'categories' => array( |
| 702 | TagsModule::POST_META_CATEGORY, |
| 703 | TagsModule::URL_CATEGORY, |
| 704 | ), |
| 705 | ), |
| 706 | 'condition' => array( |
| 707 | 'premium_gallery_video' => 'true', |
| 708 | 'premium_gallery_video_type!' => 'hosted', |
| 709 | ), |
| 710 | ) |
| 711 | ); |
| 712 | |
| 713 | $img_repeater->add_control( |
| 714 | 'premium_gallery_video_self', |
| 715 | array( |
| 716 | 'label' => __( 'Select Video', 'premium-addons-for-elementor' ), |
| 717 | 'type' => Controls_Manager::MEDIA, |
| 718 | 'dynamic' => array( |
| 719 | 'active' => true, |
| 720 | 'categories' => array( |
| 721 | TagsModule::POST_META_CATEGORY, |
| 722 | TagsModule::URL_CATEGORY, |
| 723 | ), |
| 724 | ), |
| 725 | 'media_type' => 'video', |
| 726 | 'condition' => array( |
| 727 | 'premium_gallery_video' => 'true', |
| 728 | 'premium_gallery_video_type' => 'hosted', |
| 729 | ), |
| 730 | ) |
| 731 | ); |
| 732 | |
| 733 | $img_repeater->add_control( |
| 734 | 'premium_gallery_video_self_url', |
| 735 | array( |
| 736 | 'label' => __( 'Remote Video URL', 'premium-addons-for-elementor' ), |
| 737 | 'type' => Controls_Manager::TEXT, |
| 738 | 'dynamic' => array( |
| 739 | 'active' => true, |
| 740 | ), |
| 741 | 'label_block' => true, |
| 742 | 'condition' => array( |
| 743 | 'premium_gallery_video' => 'true', |
| 744 | 'premium_gallery_video_type' => 'hosted', |
| 745 | ), |
| 746 | ) |
| 747 | ); |
| 748 | |
| 749 | $img_repeater->add_control( |
| 750 | 'premium_gallery_video_controls', |
| 751 | array( |
| 752 | 'label' => __( 'Controls', 'premium-addons-for-elementor' ), |
| 753 | 'type' => Controls_Manager::SWITCHER, |
| 754 | 'return_value' => 'true', |
| 755 | 'default' => 'true', |
| 756 | 'condition' => array( |
| 757 | 'premium_gallery_video' => 'true', |
| 758 | ), |
| 759 | ) |
| 760 | ); |
| 761 | |
| 762 | $img_repeater->add_control( |
| 763 | 'premium_gallery_video_mute', |
| 764 | array( |
| 765 | 'label' => __( 'Mute', 'premium-addons-for-elementor' ), |
| 766 | 'type' => Controls_Manager::SWITCHER, |
| 767 | 'return_value' => 'true', |
| 768 | 'condition' => array( |
| 769 | 'premium_gallery_video' => 'true', |
| 770 | ), |
| 771 | ) |
| 772 | ); |
| 773 | |
| 774 | $img_repeater->add_control( |
| 775 | 'premium_gallery_video_loop', |
| 776 | array( |
| 777 | 'label' => __( 'Loop', 'premium-addons-for-elementor' ), |
| 778 | 'type' => Controls_Manager::SWITCHER, |
| 779 | 'return_value' => 'true', |
| 780 | 'condition' => array( |
| 781 | 'premium_gallery_video' => 'true', |
| 782 | ), |
| 783 | ) |
| 784 | ); |
| 785 | |
| 786 | $img_repeater->add_control( |
| 787 | 'download_button', |
| 788 | array( |
| 789 | 'label' => __( 'Download Button', 'premium-addons-for-elementor' ), |
| 790 | 'type' => Controls_Manager::SWITCHER, |
| 791 | 'condition' => array( |
| 792 | 'premium_gallery_video' => 'true', |
| 793 | 'premium_gallery_video_type' => 'hosted', |
| 794 | ), |
| 795 | ) |
| 796 | ); |
| 797 | |
| 798 | $img_repeater->add_control( |
| 799 | 'privacy_mode', |
| 800 | array( |
| 801 | 'label' => __( 'Privacy Mode', 'premium-addons-for-elementor' ), |
| 802 | 'type' => Controls_Manager::SWITCHER, |
| 803 | 'description' => __( 'When turned on, YouTube won\'t store information about visitors on your website unless they play the video.', 'premium-addons-for-elementor' ), |
| 804 | 'condition' => array( |
| 805 | 'premium_gallery_video' => 'true', |
| 806 | 'premium_gallery_video_type' => 'youtube', |
| 807 | ), |
| 808 | ) |
| 809 | ); |
| 810 | |
| 811 | $img_repeater->add_control( |
| 812 | 'premmium_gallery_img_info', |
| 813 | array( |
| 814 | 'label' => __( 'Get Title/Description From Media Library', 'premium-addons-for-elementor' ), |
| 815 | 'type' => Controls_Manager::SWITCHER, |
| 816 | ) |
| 817 | ); |
| 818 | |
| 819 | $img_repeater->add_control( |
| 820 | 'premium_gallery_img_name', |
| 821 | array( |
| 822 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 823 | 'type' => Controls_Manager::TEXT, |
| 824 | 'dynamic' => array( 'active' => true ), |
| 825 | 'label_block' => true, |
| 826 | 'condition' => array( |
| 827 | 'premmium_gallery_img_info!' => 'yes', |
| 828 | ), |
| 829 | ) |
| 830 | ); |
| 831 | |
| 832 | $img_repeater->add_control( |
| 833 | 'premium_gallery_img_desc', |
| 834 | array( |
| 835 | 'label' => __( 'Description', 'premium-addons-for-elementor' ), |
| 836 | 'type' => Controls_Manager::TEXTAREA, |
| 837 | 'dynamic' => array( 'active' => true ), |
| 838 | 'label_block' => true, |
| 839 | 'condition' => array( |
| 840 | 'premmium_gallery_img_info!' => 'yes', |
| 841 | ), |
| 842 | ) |
| 843 | ); |
| 844 | |
| 845 | $img_repeater->add_control( |
| 846 | 'premium_gallery_img_category', |
| 847 | array( |
| 848 | 'label' => __( 'Category', 'premium-addons-for-elementor' ), |
| 849 | 'type' => Controls_Manager::TEXT, |
| 850 | 'description' => __( 'To assign for multiple categories, separate by a comma \',\'', 'premium-addons-for-elementor' ), |
| 851 | 'dynamic' => array( 'active' => true ), |
| 852 | ) |
| 853 | ); |
| 854 | |
| 855 | $img_repeater->add_control( |
| 856 | 'premium_gallery_img_link_type', |
| 857 | array( |
| 858 | 'label' => __( 'Link Type', 'premium-addons-for-elementor' ), |
| 859 | 'type' => Controls_Manager::SELECT, |
| 860 | 'options' => array( |
| 861 | 'url' => __( 'URL', 'premium-addons-for-elementor' ), |
| 862 | 'link' => __( 'Existing Page', 'premium-addons-for-elementor' ), |
| 863 | ), |
| 864 | 'default' => 'url', |
| 865 | 'label_block' => true, |
| 866 | 'condition' => array( |
| 867 | 'premium_gallery_video!' => 'true', |
| 868 | ), |
| 869 | ) |
| 870 | ); |
| 871 | |
| 872 | $img_repeater->add_control( |
| 873 | 'premium_gallery_img_link', |
| 874 | array( |
| 875 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 876 | 'type' => Controls_Manager::URL, |
| 877 | 'dynamic' => array( 'active' => true ), |
| 878 | 'placeholder' => 'https://premiumaddons.com/', |
| 879 | 'label_block' => true, |
| 880 | 'condition' => array( |
| 881 | 'premium_gallery_img_link_type' => 'url', |
| 882 | 'premium_gallery_video!' => 'true', |
| 883 | ), |
| 884 | ) |
| 885 | ); |
| 886 | |
| 887 | $img_repeater->add_control( |
| 888 | 'premium_gallery_img_existing', |
| 889 | array( |
| 890 | 'label' => __( 'Existing Page', 'premium-addons-for-elementor' ), |
| 891 | 'type' => Controls_Manager::SELECT2, |
| 892 | 'options' => $this->getTemplateInstance()->get_all_posts(), |
| 893 | 'condition' => array( |
| 894 | 'premium_gallery_img_link_type' => 'link', |
| 895 | ), |
| 896 | 'multiple' => false, |
| 897 | 'separator' => 'after', |
| 898 | 'label_block' => true, |
| 899 | 'condition' => array( |
| 900 | 'premium_gallery_img_link_type' => 'link', |
| 901 | 'premium_gallery_video!' => 'true', |
| 902 | ), |
| 903 | ) |
| 904 | ); |
| 905 | |
| 906 | $img_repeater->add_control( |
| 907 | 'premium_gallery_link_whole', |
| 908 | array( |
| 909 | 'label' => __( 'Whole Image Link', 'premium-addons-for-elementor' ), |
| 910 | 'type' => Controls_Manager::SWITCHER, |
| 911 | 'condition' => array( |
| 912 | 'premium_gallery_video!' => 'true', |
| 913 | ), |
| 914 | ) |
| 915 | ); |
| 916 | |
| 917 | $img_repeater->add_control( |
| 918 | 'premium_gallery_lightbox_whole', |
| 919 | array( |
| 920 | 'label' => __( 'Whole Image Lightbox', 'premium-addons-for-elementor' ), |
| 921 | 'type' => Controls_Manager::SWITCHER, |
| 922 | 'condition' => array( |
| 923 | 'premium_gallery_video!' => 'true', |
| 924 | ), |
| 925 | ) |
| 926 | ); |
| 927 | |
| 928 | $this->add_control( |
| 929 | 'premium_gallery_img_content', |
| 930 | array( |
| 931 | 'label' => __( 'Images', 'premium-addons-for-elementor' ), |
| 932 | 'type' => Controls_Manager::REPEATER, |
| 933 | 'default' => array( |
| 934 | array( |
| 935 | 'premium_gallery_img_name' => 'Image #1', |
| 936 | 'premium_gallery_img_category' => 'Category 1', |
| 937 | ), |
| 938 | array( |
| 939 | 'premium_gallery_img_name' => 'Image #2', |
| 940 | 'premium_gallery_img_category' => 'Category 2', |
| 941 | ), |
| 942 | ), |
| 943 | 'frontend_available' => true, |
| 944 | 'fields' => $img_repeater->get_controls(), |
| 945 | 'title_field' => '{{{ "" !== premium_gallery_img_name ? premium_gallery_img_name : "Image" }}} - {{{ "" !== premium_gallery_img_category ? premium_gallery_img_category : "No Categories" }}}', |
| 946 | ) |
| 947 | ); |
| 948 | |
| 949 | $this->add_control( |
| 950 | 'premium_gallery_shuffle_onload', |
| 951 | array( |
| 952 | 'label' => __( 'Shuffle Images on Page Load', 'premium-addons-for-elementor' ), |
| 953 | 'type' => Controls_Manager::SWITCHER, |
| 954 | 'condition' => array( |
| 955 | 'premium_gallery_load_more!' => 'yes', |
| 956 | ), |
| 957 | ) |
| 958 | ); |
| 959 | |
| 960 | $this->add_control( |
| 961 | 'premium_gallery_yt_thumbnail_size', |
| 962 | array( |
| 963 | 'label' => __( 'Youtube Videos Thumbnail Size', 'premium-addons-for-elementor' ), |
| 964 | 'type' => Controls_Manager::SELECT, |
| 965 | 'options' => array( |
| 966 | 'maxresdefault' => __( 'Maximum Resolution', 'premium-addons-for-elementor' ), |
| 967 | 'hqdefault' => __( 'High Quality', 'premium-addons-for-elementor' ), |
| 968 | 'mqdefault' => __( 'Medium Quality', 'premium-addons-for-elementor' ), |
| 969 | 'sddefault' => __( 'Standard Quality', 'premium-addons-for-elementor' ), |
| 970 | ), |
| 971 | 'default' => 'maxresdefault', |
| 972 | 'label_block' => true, |
| 973 | ) |
| 974 | ); |
| 975 | |
| 976 | $this->end_controls_section(); |
| 977 | |
| 978 | $this->start_controls_section( |
| 979 | 'premium_gallery_grid_settings', |
| 980 | array( |
| 981 | 'label' => __( 'Display Options', 'premium-addons-for-elementor' ), |
| 982 | |
| 983 | ) |
| 984 | ); |
| 985 | |
| 986 | $this->add_responsive_control( |
| 987 | 'premium_gallery_gap', |
| 988 | array( |
| 989 | 'label' => __( 'Image Gap', 'premium-addons-for-elementor' ), |
| 990 | 'type' => Controls_Manager::SLIDER, |
| 991 | 'size_units' => array( 'px', '%', 'em' ), |
| 992 | 'range' => array( |
| 993 | 'px' => array( |
| 994 | 'min' => 0, |
| 995 | 'max' => 200, |
| 996 | ), |
| 997 | ), |
| 998 | 'selectors' => array( |
| 999 | '{{WRAPPER}} .premium-gallery-item' => 'padding: {{SIZE}}{{UNIT}}', |
| 1000 | ), |
| 1001 | ) |
| 1002 | ); |
| 1003 | |
| 1004 | $this->add_control( |
| 1005 | 'premium_gallery_img_style', |
| 1006 | array( |
| 1007 | 'label' => __( 'Skin', 'premium-addons-for-elementor' ), |
| 1008 | 'type' => Controls_Manager::SELECT, |
| 1009 | 'description' => __( 'Choose a layout style for the gallery', 'premium-addons-for-elementor' ), |
| 1010 | 'options' => array( |
| 1011 | 'default' => __( 'Style 1', 'premium-addons-for-elementor' ), |
| 1012 | 'style1' => __( 'Style 2', 'premium-addons-for-elementor' ), |
| 1013 | 'style2' => __( 'Style 3', 'premium-addons-for-elementor' ), |
| 1014 | 'style3' => __( 'Style 4', 'premium-addons-for-elementor' ), |
| 1015 | ), |
| 1016 | 'default' => 'default', |
| 1017 | 'separator' => 'before', |
| 1018 | 'label_block' => true, |
| 1019 | ) |
| 1020 | ); |
| 1021 | |
| 1022 | $this->add_control( |
| 1023 | 'premium_grid_style_notice', |
| 1024 | array( |
| 1025 | 'raw' => __( 'Style 4 works only with Even / Masonry Layout', 'premium-addons-for-elementor' ), |
| 1026 | 'type' => Controls_Manager::RAW_HTML, |
| 1027 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 1028 | 'condition' => array( |
| 1029 | 'premium_gallery_img_style' => 'style3', |
| 1030 | 'premium_gallery_img_size_select' => 'metro', |
| 1031 | ), |
| 1032 | ) |
| 1033 | ); |
| 1034 | |
| 1035 | $this->add_responsive_control( |
| 1036 | 'premium_gallery_style1_border_border', |
| 1037 | array( |
| 1038 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 1039 | 'type' => Controls_Manager::SLIDER, |
| 1040 | 'range' => array( |
| 1041 | 'px' => array( |
| 1042 | 'min' => 0, |
| 1043 | 'max' => 700, |
| 1044 | ), |
| 1045 | ), |
| 1046 | 'label_block' => true, |
| 1047 | 'selectors' => array( |
| 1048 | '{{WRAPPER}} .pa-gallery-img.style1 .premium-gallery-caption' => 'bottom: {{SIZE}}px;', |
| 1049 | ), |
| 1050 | 'condition' => array( |
| 1051 | 'premium_gallery_img_style' => 'style1', |
| 1052 | ), |
| 1053 | ) |
| 1054 | ); |
| 1055 | |
| 1056 | $this->add_control( |
| 1057 | 'premium_gallery_img_effect', |
| 1058 | array( |
| 1059 | 'label' => __( 'Hover Effect', 'premium-addons-for-elementor' ), |
| 1060 | 'type' => Controls_Manager::SELECT, |
| 1061 | 'description' => __( 'Choose a hover effect for the image', 'premium-addons-for-elementor' ), |
| 1062 | 'options' => array( |
| 1063 | 'none' => __( 'None', 'premium-addons-for-elementor' ), |
| 1064 | 'zoomin' => __( 'Zoom In', 'premium-addons-for-elementor' ), |
| 1065 | 'zoomout' => __( 'Zoom Out', 'premium-addons-for-elementor' ), |
| 1066 | 'scale' => __( 'Scale', 'premium-addons-for-elementor' ), |
| 1067 | 'gray' => __( 'Grayscale', 'premium-addons-for-elementor' ), |
| 1068 | 'blur' => __( 'Blur', 'premium-addons-for-elementor' ), |
| 1069 | 'bright' => __( 'Bright', 'premium-addons-for-elementor' ), |
| 1070 | 'sepia' => __( 'Sepia', 'premium-addons-for-elementor' ), |
| 1071 | 'trans' => __( 'Translate', 'premium-addons-for-elementor' ), |
| 1072 | ), |
| 1073 | 'default' => 'zoomin', |
| 1074 | 'label_block' => true, |
| 1075 | 'separator' => 'after', |
| 1076 | ) |
| 1077 | ); |
| 1078 | |
| 1079 | $this->add_control( |
| 1080 | 'premium_gallery_links_icon', |
| 1081 | array( |
| 1082 | 'label' => __( 'Links Icon', 'premium-addons-for-elementor' ), |
| 1083 | 'type' => Controls_Manager::ICONS, |
| 1084 | 'default' => array( |
| 1085 | 'library' => 'fa-solid', |
| 1086 | 'value' => 'fas fa-link', |
| 1087 | ), |
| 1088 | ) |
| 1089 | ); |
| 1090 | |
| 1091 | $this->add_control( |
| 1092 | 'premium_gallery_videos_heading', |
| 1093 | array( |
| 1094 | 'label' => __( 'Videos', 'premium-addons-for-elementor' ), |
| 1095 | 'type' => Controls_Manager::HEADING, |
| 1096 | 'separator' => 'before', |
| 1097 | ) |
| 1098 | ); |
| 1099 | |
| 1100 | $this->add_control( |
| 1101 | 'premium_gallery_video_icon', |
| 1102 | array( |
| 1103 | 'label' => __( 'Always Show Play Icon', 'premium-addons-for-elementor' ), |
| 1104 | 'type' => Controls_Manager::SWITCHER, |
| 1105 | 'return_value' => 'true', |
| 1106 | 'default' => 'true', |
| 1107 | 'condition' => array( |
| 1108 | 'premium_gallery_img_style!' => 'style2', |
| 1109 | ), |
| 1110 | |
| 1111 | ) |
| 1112 | ); |
| 1113 | |
| 1114 | $this->add_control( |
| 1115 | 'premium_gallery_videos_icon', |
| 1116 | array( |
| 1117 | 'label' => __( 'Videos Play Icon', 'premium-addons-for-elementor' ), |
| 1118 | 'type' => Controls_Manager::ICONS, |
| 1119 | 'default' => array( |
| 1120 | 'library' => 'fa-solid', |
| 1121 | 'value' => 'fas fa-play', |
| 1122 | ), |
| 1123 | ) |
| 1124 | ); |
| 1125 | |
| 1126 | $this->add_control( |
| 1127 | 'premium_gallery_rtl_mode', |
| 1128 | array( |
| 1129 | 'label' => __( 'RTL Mode', 'premium-addons-for-elementor' ), |
| 1130 | 'description' => __( 'This option moves the origin of the grid to the right side. Useful for RTL direction sites', 'premium-addons-for-elementor' ), |
| 1131 | 'type' => Controls_Manager::SWITCHER, |
| 1132 | 'separator' => 'before', |
| 1133 | ) |
| 1134 | ); |
| 1135 | |
| 1136 | $this->add_responsive_control( |
| 1137 | 'premium_gallery_content_align', |
| 1138 | array( |
| 1139 | 'label' => __( 'Content Alignment', 'premium-addons-for-elementor' ), |
| 1140 | 'type' => Controls_Manager::CHOOSE, |
| 1141 | 'options' => array( |
| 1142 | 'left' => array( |
| 1143 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1144 | 'icon' => 'eicon-text-align-left', |
| 1145 | ), |
| 1146 | 'center' => array( |
| 1147 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1148 | 'icon' => 'eicon-text-align-center', |
| 1149 | ), |
| 1150 | 'right' => array( |
| 1151 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1152 | 'icon' => 'eicon-text-align-right', |
| 1153 | ), |
| 1154 | ), |
| 1155 | 'default' => 'center', |
| 1156 | 'separator' => 'before', |
| 1157 | 'selectors' => array( |
| 1158 | '{{WRAPPER}} .premium-gallery-caption' => 'text-align: {{VALUE}};', |
| 1159 | ), |
| 1160 | ) |
| 1161 | ); |
| 1162 | |
| 1163 | $this->end_controls_section(); |
| 1164 | |
| 1165 | $this->start_controls_section( |
| 1166 | 'premium_gallery_lightbox_section', |
| 1167 | array( |
| 1168 | 'label' => __( 'Lightbox', 'premium-addons-for-elementor' ), |
| 1169 | ) |
| 1170 | ); |
| 1171 | |
| 1172 | $this->add_control( |
| 1173 | 'premium_gallery_light_box', |
| 1174 | array( |
| 1175 | 'label' => __( 'Lightbox', 'premium-addons-for-elementor' ), |
| 1176 | 'type' => Controls_Manager::SWITCHER, |
| 1177 | 'default' => 'yes', |
| 1178 | 'separator' => 'before', |
| 1179 | ) |
| 1180 | ); |
| 1181 | |
| 1182 | $this->add_control( |
| 1183 | 'premium_gallery_lightbox_type', |
| 1184 | array( |
| 1185 | 'label' => __( 'Lightbox Style', 'premium-addons-for-elementor' ), |
| 1186 | 'type' => Controls_Manager::SELECT, |
| 1187 | 'default' => 'default', |
| 1188 | 'options' => array( |
| 1189 | 'default' => __( 'PrettyPhoto', 'premium-addons-for-elementor' ), |
| 1190 | 'yes' => __( 'Elementor', 'premium-addons-for-elementor' ), |
| 1191 | 'no' => __( 'Other Lightbox Plugin', 'premium-addons-for-elementor' ), |
| 1192 | ), |
| 1193 | 'condition' => array( |
| 1194 | 'premium_gallery_light_box' => 'yes', |
| 1195 | ), |
| 1196 | ) |
| 1197 | ); |
| 1198 | |
| 1199 | $this->add_control( |
| 1200 | 'lightbox_show_title', |
| 1201 | array( |
| 1202 | 'label' => __( 'Show Image Title', 'premium-addons-for-elementor' ), |
| 1203 | 'type' => Controls_Manager::SWITCHER, |
| 1204 | 'default' => 'yes', |
| 1205 | 'condition' => array( |
| 1206 | 'premium_gallery_light_box' => 'yes', |
| 1207 | 'premium_gallery_lightbox_type' => 'yes', |
| 1208 | ), |
| 1209 | ) |
| 1210 | ); |
| 1211 | |
| 1212 | $this->add_control( |
| 1213 | 'premium_gallery_lightbox_theme', |
| 1214 | array( |
| 1215 | 'label' => __( 'Lightbox Theme', 'premium-addons-for-elementor' ), |
| 1216 | 'type' => Controls_Manager::SELECT, |
| 1217 | 'options' => array( |
| 1218 | 'pp_default' => __( 'Default', 'premium-addons-for-elementor' ), |
| 1219 | 'light_rounded' => __( 'Light Rounded', 'premium-addons-for-elementor' ), |
| 1220 | 'dark_rounded' => __( 'Dark Rounded', 'premium-addons-for-elementor' ), |
| 1221 | 'light_square' => __( 'Light Square', 'premium-addons-for-elementor' ), |
| 1222 | 'dark_square' => __( 'Dark Square', 'premium-addons-for-elementor' ), |
| 1223 | 'facebook' => __( 'Facebook', 'premium-addons-for-elementor' ), |
| 1224 | ), |
| 1225 | 'default' => 'pp_default', |
| 1226 | 'condition' => array( |
| 1227 | 'premium_gallery_light_box' => 'yes', |
| 1228 | 'premium_gallery_lightbox_type' => 'default', |
| 1229 | ), |
| 1230 | ) |
| 1231 | ); |
| 1232 | |
| 1233 | $this->add_control( |
| 1234 | 'premium_gallery_overlay_gallery', |
| 1235 | array( |
| 1236 | 'label' => __( 'Overlay Gallery Images', 'premium-addons-for-elementor' ), |
| 1237 | 'type' => Controls_Manager::SWITCHER, |
| 1238 | 'condition' => array( |
| 1239 | 'premium_gallery_light_box' => 'yes', |
| 1240 | 'premium_gallery_lightbox_type' => 'default', |
| 1241 | ), |
| 1242 | ) |
| 1243 | ); |
| 1244 | |
| 1245 | $this->add_control( |
| 1246 | 'premium_gallery_lightbox_icon', |
| 1247 | array( |
| 1248 | 'label' => __( 'Lightbox Icon', 'premium-addons-for-elementor' ), |
| 1249 | 'type' => Controls_Manager::ICONS, |
| 1250 | 'default' => array( |
| 1251 | 'library' => 'fa-solid', |
| 1252 | 'value' => 'fas fa-search', |
| 1253 | ), |
| 1254 | 'condition' => array( |
| 1255 | 'premium_gallery_light_box' => 'yes', |
| 1256 | ), |
| 1257 | ) |
| 1258 | ); |
| 1259 | |
| 1260 | $this->end_controls_section(); |
| 1261 | |
| 1262 | $this->start_controls_section( |
| 1263 | 'premium_gallery_responsive_section', |
| 1264 | array( |
| 1265 | 'label' => __( 'Responsive', 'premium-addons-for-elementor' ), |
| 1266 | ) |
| 1267 | ); |
| 1268 | |
| 1269 | $this->add_control( |
| 1270 | 'premium_gallery_responsive_switcher', |
| 1271 | array( |
| 1272 | 'label' => __( 'Responsive Controls', 'premium-addons-for-elementor' ), |
| 1273 | 'type' => Controls_Manager::SWITCHER, |
| 1274 | 'description' => __( 'If the content text is not suiting well on specific screen sizes, you may enable this option which will hide the description text.', 'premium-addons-for-elementor' ), |
| 1275 | ) |
| 1276 | ); |
| 1277 | |
| 1278 | $this->add_control( |
| 1279 | 'premium_gallery_min_range', |
| 1280 | array( |
| 1281 | 'label' => __( 'Minimum Size', 'premium-addons-for-elementor' ), |
| 1282 | 'type' => Controls_Manager::NUMBER, |
| 1283 | 'description' => __( 'Note: minimum size for extra small screens is 1px.', 'premium-addons-for-elementor' ), |
| 1284 | 'default' => 1, |
| 1285 | 'condition' => array( |
| 1286 | 'premium_gallery_responsive_switcher' => 'yes', |
| 1287 | ), |
| 1288 | ) |
| 1289 | ); |
| 1290 | |
| 1291 | $this->add_control( |
| 1292 | 'premium_gallery_max_range', |
| 1293 | array( |
| 1294 | 'label' => __( 'Maximum Size', 'premium-addons-for-elementor' ), |
| 1295 | 'type' => Controls_Manager::NUMBER, |
| 1296 | 'description' => __( 'Note: maximum size for extra small screens is 767px.', 'premium-addons-for-elementor' ), |
| 1297 | 'default' => 767, |
| 1298 | 'condition' => array( |
| 1299 | 'premium_gallery_responsive_switcher' => 'yes', |
| 1300 | ), |
| 1301 | ) |
| 1302 | ); |
| 1303 | |
| 1304 | $this->end_controls_section(); |
| 1305 | |
| 1306 | $this->start_controls_section( |
| 1307 | 'section_pa_docs', |
| 1308 | array( |
| 1309 | 'label' => __( 'Helpful Documentations', 'premium-addons-for-elementor' ), |
| 1310 | ) |
| 1311 | ); |
| 1312 | |
| 1313 | $docs = array( |
| 1314 | 'https://premiumaddons.com/docs/grid-widget-tutorial' => __( 'Getting started »', 'premium-addons-for-elementor' ), |
| 1315 | 'https://premiumaddons.com/docs/how-to-assign-an-image-to-multiple-categories' => __( 'How to assign a grid item to multiple categories »', 'premium-addons-for-elementor' ), |
| 1316 | 'https://premiumaddons.com/docs/how-to-link-categories-in-elementor-gallery-widget/' => __( 'How To Link Categories In Media Grid Widget »', 'premium-addons-for-elementor' ), |
| 1317 | 'https://premiumaddons.com/docs/how-to-open-a-popup-lightbox-through-a-grid-image' => __( 'How to open an Elementor popup/lightbox using a grid item »', 'premium-addons-for-elementor' ), |
| 1318 | 'https://premiumaddons.com/docs/how-to-solve-media-grid-and-tabs-widgets-conflict/' => __( 'How to Solve Media Grid and Tabs Widgets Conflict »', 'premium-addons-for-elementor' ), |
| 1319 | ); |
| 1320 | |
| 1321 | $doc_index = 1; |
| 1322 | foreach ( $docs as $url => $title ) { |
| 1323 | |
| 1324 | $doc_url = Helper_Functions::get_campaign_link( $url, 'editor-page', 'wp-editor', 'get-support' ); |
| 1325 | |
| 1326 | $this->add_control( |
| 1327 | 'doc_' . $doc_index, |
| 1328 | array( |
| 1329 | 'type' => Controls_Manager::RAW_HTML, |
| 1330 | 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ), |
| 1331 | 'content_classes' => 'editor-pa-doc', |
| 1332 | ) |
| 1333 | ); |
| 1334 | |
| 1335 | $doc_index++; |
| 1336 | |
| 1337 | } |
| 1338 | |
| 1339 | $this->end_controls_section(); |
| 1340 | |
| 1341 | $this->start_controls_section( |
| 1342 | 'premium_gallery_general_style', |
| 1343 | array( |
| 1344 | 'label' => __( 'General', 'premium-addons-for-elementor' ), |
| 1345 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1346 | ) |
| 1347 | ); |
| 1348 | |
| 1349 | $this->add_group_control( |
| 1350 | Group_Control_Background::get_type(), |
| 1351 | array( |
| 1352 | 'name' => 'premium_gallery_general_background', |
| 1353 | 'types' => array( 'classic', 'gradient' ), |
| 1354 | 'selector' => '{{WRAPPER}} .premium-img-gallery', |
| 1355 | ) |
| 1356 | ); |
| 1357 | |
| 1358 | $this->add_group_control( |
| 1359 | Group_Control_Border::get_type(), |
| 1360 | array( |
| 1361 | 'name' => 'premium_gallery_general_border', |
| 1362 | 'selector' => '{{WRAPPER}} .premium-img-gallery', |
| 1363 | ) |
| 1364 | ); |
| 1365 | |
| 1366 | $this->add_control( |
| 1367 | 'premium_gallery_general_border_radius', |
| 1368 | array( |
| 1369 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1370 | 'type' => Controls_Manager::SLIDER, |
| 1371 | 'size_units' => array( 'px', '%', 'em' ), |
| 1372 | 'selectors' => array( |
| 1373 | '{{WRAPPER}} .premium-img-gallery' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1374 | ), |
| 1375 | ) |
| 1376 | ); |
| 1377 | |
| 1378 | $this->add_group_control( |
| 1379 | Group_Control_Box_Shadow::get_type(), |
| 1380 | array( |
| 1381 | 'name' => 'premium_gallery_general_box_shadow', |
| 1382 | 'selector' => '{{WRAPPER}} .premium-img-gallery', |
| 1383 | ) |
| 1384 | ); |
| 1385 | |
| 1386 | $this->add_responsive_control( |
| 1387 | 'premium_gallery_general_margin', |
| 1388 | array( |
| 1389 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1390 | 'type' => Controls_Manager::DIMENSIONS, |
| 1391 | 'size_units' => array( 'px', 'em', '%' ), |
| 1392 | 'selectors' => array( |
| 1393 | '{{WRAPPER}} .premium-img-gallery' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1394 | ), |
| 1395 | ) |
| 1396 | ); |
| 1397 | |
| 1398 | $this->add_responsive_control( |
| 1399 | 'premium_gallery_general_padding', |
| 1400 | array( |
| 1401 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1402 | 'type' => Controls_Manager::DIMENSIONS, |
| 1403 | 'size_units' => array( 'px', 'em', '%' ), |
| 1404 | 'selectors' => array( |
| 1405 | '{{WRAPPER}} .premium-img-gallery' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1406 | ), |
| 1407 | ) |
| 1408 | ); |
| 1409 | |
| 1410 | $this->end_controls_section(); |
| 1411 | |
| 1412 | $this->start_controls_section( |
| 1413 | 'premium_gallery_img_style_section', |
| 1414 | array( |
| 1415 | 'label' => __( 'Image', 'premium-addons-for-elementor' ), |
| 1416 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1417 | ) |
| 1418 | ); |
| 1419 | |
| 1420 | $this->add_control( |
| 1421 | 'premium_gallery_icons_style_overlay', |
| 1422 | array( |
| 1423 | 'label' => __( 'Hover Overlay Color', 'premium-addons-for-elementor' ), |
| 1424 | 'type' => Controls_Manager::COLOR, |
| 1425 | 'selectors' => array( |
| 1426 | '{{WRAPPER}} .pa-gallery-img:not(.style2):hover .pa-gallery-icons-wrapper, {{WRAPPER}} .pa-gallery-img .pa-gallery-icons-caption-container, {{WRAPPER}} .pa-gallery-img:hover .pa-gallery-icons-caption-container' => 'background-color: {{VALUE}};', |
| 1427 | ), |
| 1428 | ) |
| 1429 | ); |
| 1430 | |
| 1431 | $this->add_group_control( |
| 1432 | Group_Control_Border::get_type(), |
| 1433 | array( |
| 1434 | 'name' => 'premium_gallery_img_border', |
| 1435 | 'selector' => '{{WRAPPER}} .pa-gallery-img-container', |
| 1436 | ) |
| 1437 | ); |
| 1438 | |
| 1439 | $this->add_control( |
| 1440 | 'premium_gallery_img_border_radius', |
| 1441 | array( |
| 1442 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1443 | 'type' => Controls_Manager::SLIDER, |
| 1444 | 'size_units' => array( 'px', '%', 'em' ), |
| 1445 | 'selectors' => array( |
| 1446 | '{{WRAPPER}} .pa-gallery-img-container' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1447 | ), |
| 1448 | ) |
| 1449 | ); |
| 1450 | |
| 1451 | $this->add_group_control( |
| 1452 | Group_Control_Box_Shadow::get_type(), |
| 1453 | array( |
| 1454 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 1455 | 'name' => 'premium_gallery_img_box_shadow', |
| 1456 | 'selector' => '{{WRAPPER}} .pa-gallery-img-container', |
| 1457 | 'condition' => array( |
| 1458 | 'premium_gallery_img_style!' => 'style1', |
| 1459 | ), |
| 1460 | ) |
| 1461 | ); |
| 1462 | |
| 1463 | $this->add_group_control( |
| 1464 | Group_Control_Css_Filter::get_type(), |
| 1465 | array( |
| 1466 | 'name' => 'css_filters', |
| 1467 | 'selector' => '{{WRAPPER}} .pa-gallery-img-container img', |
| 1468 | ) |
| 1469 | ); |
| 1470 | |
| 1471 | $this->add_group_control( |
| 1472 | Group_Control_Css_Filter::get_type(), |
| 1473 | array( |
| 1474 | 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ), |
| 1475 | 'name' => 'hover_css_filters', |
| 1476 | 'selector' => '{{WRAPPER}} .premium-gallery-item:hover img', |
| 1477 | ) |
| 1478 | ); |
| 1479 | |
| 1480 | $this->add_responsive_control( |
| 1481 | 'premium_gallery_img_margin', |
| 1482 | array( |
| 1483 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1484 | 'type' => Controls_Manager::DIMENSIONS, |
| 1485 | 'size_units' => array( 'px', 'em', '%' ), |
| 1486 | 'selectors' => array( |
| 1487 | '{{WRAPPER}} .pa-gallery-img-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1488 | ), |
| 1489 | ) |
| 1490 | ); |
| 1491 | |
| 1492 | $this->add_responsive_control( |
| 1493 | 'premium_gallery_img_padding', |
| 1494 | array( |
| 1495 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1496 | 'type' => Controls_Manager::DIMENSIONS, |
| 1497 | 'size_units' => array( 'px', 'em', '%' ), |
| 1498 | 'selectors' => array( |
| 1499 | '{{WRAPPER}} .pa-gallery-img-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1500 | ), |
| 1501 | ) |
| 1502 | ); |
| 1503 | |
| 1504 | $this->end_controls_section(); |
| 1505 | |
| 1506 | $this->start_controls_section( |
| 1507 | 'premium_gallery_content_style', |
| 1508 | array( |
| 1509 | 'label' => __( 'Title / Description', 'premium-addons-for-elementor' ), |
| 1510 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1511 | ) |
| 1512 | ); |
| 1513 | |
| 1514 | $this->add_control( |
| 1515 | 'premium_gallery_title_heading', |
| 1516 | array( |
| 1517 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 1518 | 'type' => Controls_Manager::HEADING, |
| 1519 | ) |
| 1520 | ); |
| 1521 | |
| 1522 | $this->add_control( |
| 1523 | 'premium_gallery_title_color', |
| 1524 | array( |
| 1525 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1526 | 'type' => Controls_Manager::COLOR, |
| 1527 | 'global' => array( |
| 1528 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1529 | ), |
| 1530 | 'selectors' => array( |
| 1531 | '{{WRAPPER}} .premium-gallery-img-name, {{WRAPPER}} .premium-gallery-img-name a' => 'color: {{VALUE}};', |
| 1532 | ), |
| 1533 | ) |
| 1534 | ); |
| 1535 | |
| 1536 | $this->add_group_control( |
| 1537 | Group_Control_Typography::get_type(), |
| 1538 | array( |
| 1539 | 'name' => 'premium_gallery_title_typo', |
| 1540 | 'global' => array( |
| 1541 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1542 | ), |
| 1543 | 'selector' => '{{WRAPPER}} .premium-gallery-img-name, {{WRAPPER}} .premium-gallery-img-name a', |
| 1544 | ) |
| 1545 | ); |
| 1546 | |
| 1547 | $this->add_responsive_control( |
| 1548 | 'title_spacing', |
| 1549 | array( |
| 1550 | 'label' => __( 'Spacing', 'premium-addons-for-elementor' ), |
| 1551 | 'type' => Controls_Manager::SLIDER, |
| 1552 | 'selectors' => array( |
| 1553 | '{{WRAPPER}} .premium-gallery-img-name' => 'margin-bottom: {{SIZE}}px', |
| 1554 | ), |
| 1555 | ) |
| 1556 | ); |
| 1557 | |
| 1558 | $this->add_control( |
| 1559 | 'premium_gallery_description_heading', |
| 1560 | array( |
| 1561 | 'label' => __( 'Description', 'premium-addons-for-elementor' ), |
| 1562 | 'type' => Controls_Manager::HEADING, |
| 1563 | 'separator' => 'before', |
| 1564 | ) |
| 1565 | ); |
| 1566 | |
| 1567 | $this->add_control( |
| 1568 | 'premium_gallery_description_color', |
| 1569 | array( |
| 1570 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1571 | 'type' => Controls_Manager::COLOR, |
| 1572 | 'global' => array( |
| 1573 | 'default' => Global_Colors::COLOR_TEXT, |
| 1574 | ), |
| 1575 | 'selectors' => array( |
| 1576 | '{{WRAPPER}} .premium-gallery-img-desc, {{WRAPPER}} .premium-gallery-img-desc a' => 'color: {{VALUE}};', |
| 1577 | ), |
| 1578 | ) |
| 1579 | ); |
| 1580 | |
| 1581 | $this->add_group_control( |
| 1582 | Group_Control_Typography::get_type(), |
| 1583 | array( |
| 1584 | 'name' => 'premium_gallery_description_typo', |
| 1585 | 'global' => array( |
| 1586 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1587 | ), |
| 1588 | 'selector' => '{{WRAPPER}} .premium-gallery-img-desc, {{WRAPPER}} .premium-gallery-img-desc a', |
| 1589 | ) |
| 1590 | ); |
| 1591 | |
| 1592 | $this->add_control( |
| 1593 | 'container_heading', |
| 1594 | array( |
| 1595 | 'label' => __( 'Container', 'premium-addons-for-elementor' ), |
| 1596 | 'type' => Controls_Manager::HEADING, |
| 1597 | ) |
| 1598 | ); |
| 1599 | |
| 1600 | $this->add_group_control( |
| 1601 | Group_Control_Background::get_type(), |
| 1602 | array( |
| 1603 | 'name' => 'premium_gallery_content_background', |
| 1604 | 'types' => array( 'classic', 'gradient' ), |
| 1605 | 'selector' => '{{WRAPPER}} .premium-gallery-caption', |
| 1606 | 'separator' => 'before', |
| 1607 | ) |
| 1608 | ); |
| 1609 | |
| 1610 | $this->add_group_control( |
| 1611 | Group_Control_Border::get_type(), |
| 1612 | array( |
| 1613 | 'name' => 'premium_gallery_content_border', |
| 1614 | 'selector' => '{{WRAPPER}} .premium-gallery-caption', |
| 1615 | ) |
| 1616 | ); |
| 1617 | |
| 1618 | $this->add_control( |
| 1619 | 'premium_gallery_content_border_radius', |
| 1620 | array( |
| 1621 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1622 | 'type' => Controls_Manager::SLIDER, |
| 1623 | 'size_units' => array( 'px', '%', 'em' ), |
| 1624 | 'selectors' => array( |
| 1625 | '{{WRAPPER}} .premium-gallery-caption' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1626 | ), |
| 1627 | ) |
| 1628 | ); |
| 1629 | |
| 1630 | $this->add_group_control( |
| 1631 | Group_Control_Text_Shadow::get_type(), |
| 1632 | array( |
| 1633 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 1634 | 'name' => 'premium_gallery_content_shadow', |
| 1635 | 'selector' => '{{WRAPPER}} .premium-gallery-caption', |
| 1636 | ) |
| 1637 | ); |
| 1638 | |
| 1639 | $this->add_group_control( |
| 1640 | Group_Control_Box_Shadow::get_type(), |
| 1641 | array( |
| 1642 | 'name' => 'premium_gallery_content_box_shadow', |
| 1643 | 'selector' => '{{WRAPPER}} .premium-gallery-caption', |
| 1644 | ) |
| 1645 | ); |
| 1646 | |
| 1647 | $this->add_responsive_control( |
| 1648 | 'premium_gallery_content_margin', |
| 1649 | array( |
| 1650 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1651 | 'type' => Controls_Manager::DIMENSIONS, |
| 1652 | 'size_units' => array( 'px', 'em', '%' ), |
| 1653 | 'selectors' => array( |
| 1654 | '{{WRAPPER}} .premium-gallery-caption' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1655 | ), |
| 1656 | ) |
| 1657 | ); |
| 1658 | |
| 1659 | $this->add_responsive_control( |
| 1660 | 'premium_gallery_content_padding', |
| 1661 | array( |
| 1662 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1663 | 'type' => Controls_Manager::DIMENSIONS, |
| 1664 | 'size_units' => array( 'px', 'em', '%' ), |
| 1665 | 'selectors' => array( |
| 1666 | '{{WRAPPER}} .premium-gallery-caption' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1667 | ), |
| 1668 | ) |
| 1669 | ); |
| 1670 | |
| 1671 | $this->end_controls_section(); |
| 1672 | |
| 1673 | $this->start_controls_section( |
| 1674 | 'premium_gallery_icons_style', |
| 1675 | array( |
| 1676 | 'label' => __( 'Icons', 'premium-addons-for-elementor' ), |
| 1677 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1678 | ) |
| 1679 | ); |
| 1680 | |
| 1681 | $this->add_responsive_control( |
| 1682 | 'premium_gallery_style1_icons_position', |
| 1683 | array( |
| 1684 | 'label' => __( 'Position', 'premium-addons-for-elementor' ), |
| 1685 | 'type' => Controls_Manager::SLIDER, |
| 1686 | 'size_units' => array( 'px', '%', 'em', 'custom' ), |
| 1687 | 'range' => array( |
| 1688 | 'px' => array( |
| 1689 | 'min' => 0, |
| 1690 | 'max' => 300, |
| 1691 | ), |
| 1692 | ), |
| 1693 | 'label_block' => true, |
| 1694 | 'selectors' => array( |
| 1695 | '{{WRAPPER}} .pa-gallery-img:not(.style2) .pa-gallery-icons-inner-container' => 'top: {{SIZE}}{{UNIT}};', |
| 1696 | ), |
| 1697 | 'condition' => array( |
| 1698 | 'premium_gallery_img_style!' => 'style2', |
| 1699 | ), |
| 1700 | ) |
| 1701 | ); |
| 1702 | |
| 1703 | $this->add_responsive_control( |
| 1704 | 'premium_gallery_icons_size', |
| 1705 | array( |
| 1706 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1707 | 'type' => Controls_Manager::SLIDER, |
| 1708 | 'size_units' => array( 'px', 'em' ), |
| 1709 | 'range' => array( |
| 1710 | 'px' => array( |
| 1711 | 'min' => 1, |
| 1712 | 'max' => 50, |
| 1713 | ), |
| 1714 | ), |
| 1715 | 'label_block' => true, |
| 1716 | 'selectors' => array( |
| 1717 | '{{WRAPPER}} .pa-gallery-icons-inner-container i, {{WRAPPER}} .pa-gallery-icons-caption-cell i' => 'font-size: {{SIZE}}{{UNIT}}', |
| 1718 | '{{WRAPPER}} .pa-gallery-icons-inner-container svg, {{WRAPPER}} .pa-gallery-icons-caption-cell svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', |
| 1719 | ), |
| 1720 | ) |
| 1721 | ); |
| 1722 | |
| 1723 | $this->start_controls_tabs( 'premium_gallery_icons_style_tabs' ); |
| 1724 | |
| 1725 | $this->start_controls_tab( |
| 1726 | 'premium_gallery_icons_style_normal', |
| 1727 | array( |
| 1728 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 1729 | ) |
| 1730 | ); |
| 1731 | |
| 1732 | $this->add_control( |
| 1733 | 'premium_gallery_icons_style_color', |
| 1734 | array( |
| 1735 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1736 | 'type' => Controls_Manager::COLOR, |
| 1737 | 'global' => array( |
| 1738 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1739 | ), |
| 1740 | 'selectors' => array( |
| 1741 | '{{WRAPPER}} .pa-gallery-magnific-image i, {{WRAPPER}} .pa-gallery-img-link i' => 'color: {{VALUE}};', |
| 1742 | '{{WRAPPER}} .pa-gallery-magnific-image svg, {{WRAPPER}} .pa-gallery-img-link svg' => 'fill: {{VALUE}}; color: {{VALUE}}', |
| 1743 | ), |
| 1744 | ) |
| 1745 | ); |
| 1746 | |
| 1747 | $this->add_control( |
| 1748 | 'premium_gallery_icons_style_background', |
| 1749 | array( |
| 1750 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1751 | 'type' => Controls_Manager::COLOR, |
| 1752 | 'global' => array( |
| 1753 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1754 | ), |
| 1755 | 'selectors' => array( |
| 1756 | '{{WRAPPER}} .pa-gallery-magnific-image span, {{WRAPPER}} .pa-gallery-img-link span' => 'background-color: {{VALUE}};', |
| 1757 | ), |
| 1758 | ) |
| 1759 | ); |
| 1760 | |
| 1761 | $this->add_group_control( |
| 1762 | Group_Control_Border::get_type(), |
| 1763 | array( |
| 1764 | 'name' => 'premium_gallery_icons_style_border', |
| 1765 | 'selector' => '{{WRAPPER}} .pa-gallery-magnific-image span, {{WRAPPER}} .pa-gallery-img-link span', |
| 1766 | ) |
| 1767 | ); |
| 1768 | |
| 1769 | $this->add_control( |
| 1770 | 'premium_gallery_icons_style_border_radius', |
| 1771 | array( |
| 1772 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1773 | 'type' => Controls_Manager::SLIDER, |
| 1774 | 'size_units' => array( 'px', 'em', '%' ), |
| 1775 | 'selectors' => array( |
| 1776 | '{{WRAPPER}} .pa-gallery-magnific-image span, {{WRAPPER}} .pa-gallery-img-link span' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1777 | ), |
| 1778 | ) |
| 1779 | ); |
| 1780 | |
| 1781 | $this->add_group_control( |
| 1782 | Group_Control_Box_Shadow::get_type(), |
| 1783 | array( |
| 1784 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 1785 | 'name' => 'premium_gallery_icons_style_shadow', |
| 1786 | 'selector' => '{{WRAPPER}} .pa-gallery-magnific-image span, {{WRAPPER}} .pa-gallery-img-link span', |
| 1787 | ) |
| 1788 | ); |
| 1789 | |
| 1790 | $this->add_responsive_control( |
| 1791 | 'premium_gallery_icons_style_margin', |
| 1792 | array( |
| 1793 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1794 | 'type' => Controls_Manager::DIMENSIONS, |
| 1795 | 'size_units' => array( 'px', 'em', '%' ), |
| 1796 | 'selectors' => array( |
| 1797 | '{{WRAPPER}} .pa-gallery-magnific-image span, {{WRAPPER}} .pa-gallery-img-link span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1798 | ), |
| 1799 | ) |
| 1800 | ); |
| 1801 | |
| 1802 | $this->add_responsive_control( |
| 1803 | 'premium_gallery_icons_style_padding', |
| 1804 | array( |
| 1805 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1806 | 'type' => Controls_Manager::DIMENSIONS, |
| 1807 | 'size_units' => array( 'px', 'em', '%' ), |
| 1808 | 'selectors' => array( |
| 1809 | '{{WRAPPER}} .pa-gallery-magnific-image span, {{WRAPPER}} .pa-gallery-img-link span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1810 | ), |
| 1811 | ) |
| 1812 | ); |
| 1813 | |
| 1814 | $this->end_controls_tab(); |
| 1815 | |
| 1816 | $this->start_controls_tab( |
| 1817 | 'premium_gallery_icons_style_hover', |
| 1818 | array( |
| 1819 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 1820 | ) |
| 1821 | ); |
| 1822 | |
| 1823 | $this->add_control( |
| 1824 | 'premium_gallery_icons_style_color_hover', |
| 1825 | array( |
| 1826 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1827 | 'type' => Controls_Manager::COLOR, |
| 1828 | 'global' => array( |
| 1829 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1830 | ), |
| 1831 | 'selectors' => array( |
| 1832 | '{{WRAPPER}} .pa-gallery-magnific-image:hover i, {{WRAPPER}} .pa-gallery-img-link:hover i' => 'color: {{VALUE}}', |
| 1833 | '{{WRAPPER}} .pa-gallery-magnific-image:hover svg, {{WRAPPER}} .pa-gallery-img-link:hover svg' => 'fill: {{VALUE}}; color: {{VALUE}}', |
| 1834 | ), |
| 1835 | ) |
| 1836 | ); |
| 1837 | |
| 1838 | $this->add_control( |
| 1839 | 'premium_gallery_icons_style_background_hover', |
| 1840 | array( |
| 1841 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1842 | 'type' => Controls_Manager::COLOR, |
| 1843 | 'global' => array( |
| 1844 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1845 | ), |
| 1846 | 'selectors' => array( |
| 1847 | '{{WRAPPER}} .pa-gallery-magnific-image:hover span, {{WRAPPER}} .pa-gallery-img-link:hover span' => 'background-color: {{VALUE}};', |
| 1848 | ), |
| 1849 | ) |
| 1850 | ); |
| 1851 | |
| 1852 | $this->add_group_control( |
| 1853 | Group_Control_Border::get_type(), |
| 1854 | array( |
| 1855 | 'name' => 'premium_gallery_icons_style_border_hover', |
| 1856 | 'selector' => '{{WRAPPER}} .pa-gallery-magnific-image:hover span, {{WRAPPER}} .pa-gallery-img-link:hover span', |
| 1857 | ) |
| 1858 | ); |
| 1859 | |
| 1860 | $this->add_control( |
| 1861 | 'premium_gallery_icons_style_border_radius_hover', |
| 1862 | array( |
| 1863 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1864 | 'type' => Controls_Manager::SLIDER, |
| 1865 | 'size_units' => array( 'px', 'em', '%' ), |
| 1866 | 'selectors' => array( |
| 1867 | '{{WRAPPER}} .pa-gallery-magnific-image:hover span, {{WRAPPER}} .pa-gallery-img-link:hover span' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1868 | ), |
| 1869 | ) |
| 1870 | ); |
| 1871 | |
| 1872 | $this->add_group_control( |
| 1873 | Group_Control_Box_Shadow::get_type(), |
| 1874 | array( |
| 1875 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 1876 | 'name' => 'premium_gallery_icons_style_shadow_hover', |
| 1877 | 'selector' => '{{WRAPPER}} {{WRAPPER}} .pa-gallery-magnific-image:hover span, {{WRAPPER}} .pa-gallery-img-link:hover span', |
| 1878 | ) |
| 1879 | ); |
| 1880 | |
| 1881 | $this->add_responsive_control( |
| 1882 | 'premium_gallery_icons_style_margin_hover', |
| 1883 | array( |
| 1884 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1885 | 'type' => Controls_Manager::DIMENSIONS, |
| 1886 | 'size_units' => array( 'px', 'em', '%' ), |
| 1887 | 'selectors' => array( |
| 1888 | '{{WRAPPER}} .pa-gallery-magnific-image:hover span, {{WRAPPER}} .pa-gallery-img-link:hover span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1889 | ), |
| 1890 | ) |
| 1891 | ); |
| 1892 | |
| 1893 | $this->add_responsive_control( |
| 1894 | 'premium_gallery_icons_style_padding_hover', |
| 1895 | array( |
| 1896 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1897 | 'type' => Controls_Manager::DIMENSIONS, |
| 1898 | 'size_units' => array( 'px', 'em', '%' ), |
| 1899 | 'selectors' => array( |
| 1900 | '{{WRAPPER}} .pa-gallery-magnific-image:hover span, {{WRAPPER}} .pa-gallery-img-link:hover span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1901 | ), |
| 1902 | ) |
| 1903 | ); |
| 1904 | |
| 1905 | $this->end_controls_tab(); |
| 1906 | |
| 1907 | $this->end_controls_tabs(); |
| 1908 | |
| 1909 | $this->end_controls_section(); |
| 1910 | |
| 1911 | $this->start_controls_section( |
| 1912 | 'premium_gallery_filter_style', |
| 1913 | array( |
| 1914 | 'label' => __( 'Filter', 'premium-addons-for-elementor' ), |
| 1915 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1916 | 'condition' => array( |
| 1917 | 'premium_gallery_filter' => 'yes', |
| 1918 | ), |
| 1919 | ) |
| 1920 | ); |
| 1921 | |
| 1922 | $this->add_group_control( |
| 1923 | Group_Control_Typography::get_type(), |
| 1924 | array( |
| 1925 | 'name' => 'premium_gallery_filter_typo', |
| 1926 | 'global' => array( |
| 1927 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 1928 | ), |
| 1929 | 'selector' => '{{WRAPPER}} .premium-gallery-cats-container li a.category', |
| 1930 | ) |
| 1931 | ); |
| 1932 | |
| 1933 | $this->start_controls_tabs( 'premium_gallery_filters' ); |
| 1934 | |
| 1935 | $this->start_controls_tab( |
| 1936 | 'premium_gallery_filters_normal', |
| 1937 | array( |
| 1938 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 1939 | ) |
| 1940 | ); |
| 1941 | |
| 1942 | $this->add_control( |
| 1943 | 'premium_gallery_filter_color', |
| 1944 | array( |
| 1945 | 'label' => __( 'Text Color', 'premium-addons-for-elementor' ), |
| 1946 | 'type' => Controls_Manager::COLOR, |
| 1947 | 'global' => array( |
| 1948 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1949 | ), |
| 1950 | 'selectors' => array( |
| 1951 | '{{WRAPPER}} .premium-gallery-cats-container li a.category' => 'color: {{VALUE}};', |
| 1952 | ), |
| 1953 | ) |
| 1954 | ); |
| 1955 | |
| 1956 | $this->add_control( |
| 1957 | 'premium_gallery_background_color', |
| 1958 | array( |
| 1959 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1960 | 'type' => Controls_Manager::COLOR, |
| 1961 | 'selectors' => array( |
| 1962 | '{{WRAPPER}} .premium-gallery-cats-container li a.category' => 'background-color: {{VALUE}};', |
| 1963 | ), |
| 1964 | ) |
| 1965 | ); |
| 1966 | |
| 1967 | $this->add_group_control( |
| 1968 | Group_Control_Border::get_type(), |
| 1969 | array( |
| 1970 | 'name' => 'premium_gallery_filter_border', |
| 1971 | 'selector' => '{{WRAPPER}} .premium-gallery-cats-container li a.category', |
| 1972 | ) |
| 1973 | ); |
| 1974 | |
| 1975 | $this->add_control( |
| 1976 | 'premium_gallery_filter_border_radius', |
| 1977 | array( |
| 1978 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1979 | 'type' => Controls_Manager::SLIDER, |
| 1980 | 'size_units' => array( 'px', 'em', '%' ), |
| 1981 | 'selectors' => array( |
| 1982 | '{{WRAPPER}} .premium-gallery-cats-container li a.category' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1983 | ), |
| 1984 | 'condition' => array( |
| 1985 | 'filter_adv_radius!' => 'yes', |
| 1986 | ), |
| 1987 | ) |
| 1988 | ); |
| 1989 | |
| 1990 | $this->add_control( |
| 1991 | 'filter_adv_radius', |
| 1992 | array( |
| 1993 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 1994 | 'type' => Controls_Manager::SWITCHER, |
| 1995 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>', |
| 1996 | ) |
| 1997 | ); |
| 1998 | |
| 1999 | $this->add_control( |
| 2000 | 'filter_adv_radius_value', |
| 2001 | array( |
| 2002 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2003 | 'type' => Controls_Manager::TEXT, |
| 2004 | 'dynamic' => array( 'active' => true ), |
| 2005 | 'selectors' => array( |
| 2006 | '{{WRAPPER}} .premium-gallery-cats-container li a.category' => 'border-radius: {{VALUE}};', |
| 2007 | ), |
| 2008 | 'condition' => array( |
| 2009 | 'filter_adv_radius' => 'yes', |
| 2010 | ), |
| 2011 | ) |
| 2012 | ); |
| 2013 | |
| 2014 | $this->end_controls_tab(); |
| 2015 | |
| 2016 | $this->start_controls_tab( |
| 2017 | 'premium_gallery_filters_hover', |
| 2018 | array( |
| 2019 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 2020 | ) |
| 2021 | ); |
| 2022 | |
| 2023 | $this->add_control( |
| 2024 | 'premium_gallery_filter_hover_color', |
| 2025 | array( |
| 2026 | 'label' => __( 'Text Color', 'premium-addons-for-elementor' ), |
| 2027 | 'type' => Controls_Manager::COLOR, |
| 2028 | 'selectors' => array( |
| 2029 | '{{WRAPPER}} .premium-gallery-cats-container li a:hover' => 'color: {{VALUE}};', |
| 2030 | ), |
| 2031 | ) |
| 2032 | ); |
| 2033 | |
| 2034 | $this->add_control( |
| 2035 | 'premium_gallery_background_hover_color', |
| 2036 | array( |
| 2037 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2038 | 'type' => Controls_Manager::COLOR, |
| 2039 | 'selectors' => array( |
| 2040 | '{{WRAPPER}} .premium-gallery-cats-container li a:hover' => 'background-color: {{VALUE}};', |
| 2041 | ), |
| 2042 | ) |
| 2043 | ); |
| 2044 | |
| 2045 | $this->add_group_control( |
| 2046 | Group_Control_Border::get_type(), |
| 2047 | array( |
| 2048 | 'name' => 'premium_gallery_filter_border_hover', |
| 2049 | 'selector' => '{{WRAPPER}} .premium-gallery-cats-container li a.category:hover', |
| 2050 | ) |
| 2051 | ); |
| 2052 | |
| 2053 | $this->add_control( |
| 2054 | 'premium_gallery_filter_border_radius_hover', |
| 2055 | array( |
| 2056 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2057 | 'type' => Controls_Manager::SLIDER, |
| 2058 | 'size_units' => array( 'px', 'em', '%' ), |
| 2059 | 'selectors' => array( |
| 2060 | '{{WRAPPER}} .premium-gallery-cats-container li a.category:hover' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2061 | ), |
| 2062 | 'condition' => array( |
| 2063 | 'filter_hover_adv_radius!' => 'yes', |
| 2064 | ), |
| 2065 | ) |
| 2066 | ); |
| 2067 | |
| 2068 | $this->add_control( |
| 2069 | 'filter_hover_adv_radius', |
| 2070 | array( |
| 2071 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 2072 | 'type' => Controls_Manager::SWITCHER, |
| 2073 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>', |
| 2074 | ) |
| 2075 | ); |
| 2076 | |
| 2077 | $this->add_control( |
| 2078 | 'filter_hover_adv_radius_value', |
| 2079 | array( |
| 2080 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2081 | 'type' => Controls_Manager::TEXT, |
| 2082 | 'dynamic' => array( 'active' => true ), |
| 2083 | 'selectors' => array( |
| 2084 | '{{WRAPPER}} .premium-gallery-cats-container li a.category:hover' => 'border-radius: {{VALUE}};', |
| 2085 | ), |
| 2086 | 'condition' => array( |
| 2087 | 'filter_hover_adv_radius' => 'yes', |
| 2088 | ), |
| 2089 | ) |
| 2090 | ); |
| 2091 | |
| 2092 | $this->end_controls_tab(); |
| 2093 | |
| 2094 | $this->start_controls_tab( |
| 2095 | 'premium_gallery_filters_active', |
| 2096 | array( |
| 2097 | 'label' => __( 'Active', 'premium-addons-for-elementor' ), |
| 2098 | ) |
| 2099 | ); |
| 2100 | |
| 2101 | $this->add_control( |
| 2102 | 'premium_gallery_filter_active_color', |
| 2103 | array( |
| 2104 | 'label' => __( 'Text Color', 'premium-addons-for-elementor' ), |
| 2105 | 'type' => Controls_Manager::COLOR, |
| 2106 | 'global' => array( |
| 2107 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2108 | ), |
| 2109 | 'selectors' => array( |
| 2110 | '{{WRAPPER}} .premium-gallery-cats-container li a.active' => 'color: {{VALUE}};', |
| 2111 | ), |
| 2112 | ) |
| 2113 | ); |
| 2114 | |
| 2115 | $this->add_control( |
| 2116 | 'premium_gallery_background_active_color', |
| 2117 | array( |
| 2118 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2119 | 'type' => Controls_Manager::COLOR, |
| 2120 | 'selectors' => array( |
| 2121 | '{{WRAPPER}} .premium-gallery-cats-container li a.active' => 'background-color: {{VALUE}};', |
| 2122 | ), |
| 2123 | ) |
| 2124 | ); |
| 2125 | |
| 2126 | $this->add_group_control( |
| 2127 | Group_Control_Border::get_type(), |
| 2128 | array( |
| 2129 | 'name' => 'premium_gallery_filter_border_active', |
| 2130 | 'selector' => '{{WRAPPER}} .premium-gallery-cats-container li a.active', |
| 2131 | ) |
| 2132 | ); |
| 2133 | |
| 2134 | $this->add_control( |
| 2135 | 'premium_gallery_filter_border_radius_active', |
| 2136 | array( |
| 2137 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2138 | 'type' => Controls_Manager::SLIDER, |
| 2139 | 'size_units' => array( 'px', 'em', '%' ), |
| 2140 | 'selectors' => array( |
| 2141 | '{{WRAPPER}} .premium-gallery-cats-container li a.active' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2142 | ), |
| 2143 | 'condition' => array( |
| 2144 | 'filter_active_adv_radius!' => 'yes', |
| 2145 | ), |
| 2146 | ) |
| 2147 | ); |
| 2148 | |
| 2149 | $this->add_control( |
| 2150 | 'filter_active_adv_radius', |
| 2151 | array( |
| 2152 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 2153 | 'type' => Controls_Manager::SWITCHER, |
| 2154 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>', |
| 2155 | ) |
| 2156 | ); |
| 2157 | |
| 2158 | $this->add_control( |
| 2159 | 'filter_active_adv_radius_value', |
| 2160 | array( |
| 2161 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2162 | 'type' => Controls_Manager::TEXT, |
| 2163 | 'dynamic' => array( 'active' => true ), |
| 2164 | 'selectors' => array( |
| 2165 | '{{WRAPPER}} .premium-gallery-cats-container li a.active' => 'border-radius: {{VALUE}};', |
| 2166 | ), |
| 2167 | 'condition' => array( |
| 2168 | 'filter_active_adv_radius' => 'yes', |
| 2169 | ), |
| 2170 | ) |
| 2171 | ); |
| 2172 | |
| 2173 | $this->end_controls_tab(); |
| 2174 | |
| 2175 | $this->end_controls_tabs(); |
| 2176 | |
| 2177 | $this->add_group_control( |
| 2178 | Group_Control_Box_Shadow::get_type(), |
| 2179 | array( |
| 2180 | 'name' => 'premium_gallery_filter_shadow', |
| 2181 | 'selector' => '{{WRAPPER}} .premium-gallery-cats-container li a.category', |
| 2182 | ) |
| 2183 | ); |
| 2184 | |
| 2185 | $this->add_responsive_control( |
| 2186 | 'premium_gallery_filter_margin', |
| 2187 | array( |
| 2188 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2189 | 'type' => Controls_Manager::DIMENSIONS, |
| 2190 | 'size_units' => array( 'px', 'em', '%' ), |
| 2191 | 'selectors' => array( |
| 2192 | '{{WRAPPER}} .premium-gallery-cats-container li a.category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2193 | ), |
| 2194 | ) |
| 2195 | ); |
| 2196 | |
| 2197 | $this->add_responsive_control( |
| 2198 | 'premium_gallery_filter_padding', |
| 2199 | array( |
| 2200 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2201 | 'type' => Controls_Manager::DIMENSIONS, |
| 2202 | 'size_units' => array( 'px', 'em', '%' ), |
| 2203 | 'selectors' => array( |
| 2204 | '{{WRAPPER}} .premium-gallery-cats-container li a.category' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2205 | ), |
| 2206 | ) |
| 2207 | ); |
| 2208 | |
| 2209 | $this->end_controls_section(); |
| 2210 | |
| 2211 | $this->start_controls_section( |
| 2212 | 'premium_gallery_button_style_settings', |
| 2213 | array( |
| 2214 | 'label' => __( 'Load More Button', 'premium-addons-for-elementor' ), |
| 2215 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2216 | 'condition' => array( |
| 2217 | 'premium_gallery_load_more' => 'yes', |
| 2218 | ), |
| 2219 | ) |
| 2220 | ); |
| 2221 | |
| 2222 | $this->add_group_control( |
| 2223 | Group_Control_Typography::get_type(), |
| 2224 | array( |
| 2225 | 'name' => 'premium_gallery_button_typo', |
| 2226 | 'global' => array( |
| 2227 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2228 | ), |
| 2229 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn', |
| 2230 | ) |
| 2231 | ); |
| 2232 | |
| 2233 | $this->start_controls_tabs( 'premium_gallery_button_style_tabs' ); |
| 2234 | |
| 2235 | $this->start_controls_tab( |
| 2236 | 'premium_gallery_button_style_normal', |
| 2237 | array( |
| 2238 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 2239 | ) |
| 2240 | ); |
| 2241 | |
| 2242 | $this->add_control( |
| 2243 | 'premium_gallery_button_color', |
| 2244 | array( |
| 2245 | 'label' => __( 'Text Color', 'premium-addons-for-elementor' ), |
| 2246 | 'type' => Controls_Manager::COLOR, |
| 2247 | 'global' => array( |
| 2248 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2249 | ), |
| 2250 | 'selectors' => array( |
| 2251 | '{{WRAPPER}} .premium-gallery-load-more-btn' => 'color: {{VALUE}};', |
| 2252 | '{{WRAPPER}} .premium-gallery-load-more-btn .premium-loader' => 'border-color: {{VALUE}};', |
| 2253 | ), |
| 2254 | ) |
| 2255 | ); |
| 2256 | |
| 2257 | $this->add_control( |
| 2258 | 'premium_gallery_button_spin_color', |
| 2259 | array( |
| 2260 | 'label' => __( 'Spinner Color', 'premium-addons-for-elementor' ), |
| 2261 | 'type' => Controls_Manager::COLOR, |
| 2262 | 'global' => array( |
| 2263 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2264 | ), |
| 2265 | 'selectors' => array( |
| 2266 | '{{WRAPPER}} .premium-gallery-load-more-btn .premium-loader' => 'border-top-color: {{VALUE}};', |
| 2267 | ), |
| 2268 | ) |
| 2269 | ); |
| 2270 | |
| 2271 | $this->add_group_control( |
| 2272 | Group_Control_Text_Shadow::get_type(), |
| 2273 | array( |
| 2274 | 'name' => 'premium_gallery_button_text_shadow', |
| 2275 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn', |
| 2276 | ) |
| 2277 | ); |
| 2278 | |
| 2279 | $this->add_group_control( |
| 2280 | Group_Control_Background::get_type(), |
| 2281 | array( |
| 2282 | 'name' => 'premium_gallery_button_background', |
| 2283 | 'types' => array( 'classic', 'gradient' ), |
| 2284 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn', |
| 2285 | ) |
| 2286 | ); |
| 2287 | |
| 2288 | $this->add_group_control( |
| 2289 | Group_Control_Border::get_type(), |
| 2290 | array( |
| 2291 | 'name' => 'premium_gallery_button_border', |
| 2292 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn', |
| 2293 | ) |
| 2294 | ); |
| 2295 | |
| 2296 | $this->add_control( |
| 2297 | 'premium_gallery_button_border_radius', |
| 2298 | array( |
| 2299 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2300 | 'type' => Controls_Manager::SLIDER, |
| 2301 | 'size_units' => array( 'px', 'em', '%' ), |
| 2302 | 'selectors' => array( |
| 2303 | '{{WRAPPER}} .premium-gallery-load-more-btn' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2304 | ), |
| 2305 | ) |
| 2306 | ); |
| 2307 | |
| 2308 | $this->add_group_control( |
| 2309 | Group_Control_Box_Shadow::get_type(), |
| 2310 | array( |
| 2311 | 'name' => 'premium_gallery_button_box_shadow', |
| 2312 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn', |
| 2313 | ) |
| 2314 | ); |
| 2315 | |
| 2316 | $this->add_responsive_control( |
| 2317 | 'premium_gallery_button_margin', |
| 2318 | array( |
| 2319 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2320 | 'type' => Controls_Manager::DIMENSIONS, |
| 2321 | 'size_units' => array( 'px', 'em', '%' ), |
| 2322 | 'selectors' => array( |
| 2323 | '{{WRAPPER}} .premium-gallery-load-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2324 | ), |
| 2325 | ) |
| 2326 | ); |
| 2327 | |
| 2328 | $this->add_responsive_control( |
| 2329 | 'premium_gallery_button_padding', |
| 2330 | array( |
| 2331 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2332 | 'type' => Controls_Manager::DIMENSIONS, |
| 2333 | 'size_units' => array( 'px', 'em', '%' ), |
| 2334 | 'selectors' => array( |
| 2335 | '{{WRAPPER}} .premium-gallery-load-more-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2336 | ), |
| 2337 | ) |
| 2338 | ); |
| 2339 | |
| 2340 | $this->end_controls_tab(); |
| 2341 | |
| 2342 | $this->start_controls_tab( |
| 2343 | 'premium_gallery_button_style_hover', |
| 2344 | array( |
| 2345 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 2346 | ) |
| 2347 | ); |
| 2348 | |
| 2349 | $this->add_control( |
| 2350 | 'premium_gallery_button_hover_color', |
| 2351 | array( |
| 2352 | 'label' => __( 'Text Hover Color', 'premium-addons-for-elementor' ), |
| 2353 | 'type' => Controls_Manager::COLOR, |
| 2354 | 'global' => array( |
| 2355 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2356 | ), |
| 2357 | 'selectors' => array( |
| 2358 | '{{WRAPPER}} .premium-gallery-load-more-btn:hover' => 'color: {{VALUE}};', |
| 2359 | ), |
| 2360 | ) |
| 2361 | ); |
| 2362 | |
| 2363 | $this->add_group_control( |
| 2364 | Group_Control_Text_Shadow::get_type(), |
| 2365 | array( |
| 2366 | 'name' => 'premium_gallery_button_text_shadow_hover', |
| 2367 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn:hover', |
| 2368 | ) |
| 2369 | ); |
| 2370 | |
| 2371 | $this->add_group_control( |
| 2372 | Group_Control_Background::get_type(), |
| 2373 | array( |
| 2374 | 'name' => 'premium_gallery_button_background_hover', |
| 2375 | 'types' => array( 'classic', 'gradient' ), |
| 2376 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn:hover', |
| 2377 | ) |
| 2378 | ); |
| 2379 | |
| 2380 | $this->add_group_control( |
| 2381 | Group_Control_Border::get_type(), |
| 2382 | array( |
| 2383 | 'name' => 'premium_gallery_button_border_hover', |
| 2384 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn:hover', |
| 2385 | ) |
| 2386 | ); |
| 2387 | |
| 2388 | $this->add_control( |
| 2389 | 'button_border_radius_hover', |
| 2390 | array( |
| 2391 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2392 | 'type' => Controls_Manager::SLIDER, |
| 2393 | 'size_units' => array( 'px', 'em', '%' ), |
| 2394 | 'selectors' => array( |
| 2395 | '{{WRAPPER}} .premium-gallery-load-more-btn:hover' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2396 | ), |
| 2397 | ) |
| 2398 | ); |
| 2399 | |
| 2400 | $this->add_group_control( |
| 2401 | Group_Control_Box_Shadow::get_type(), |
| 2402 | array( |
| 2403 | 'name' => 'premium_gallery_button_shadow_hover', |
| 2404 | 'selector' => '{{WRAPPER}} .premium-gallery-load-more-btn:hover', |
| 2405 | ) |
| 2406 | ); |
| 2407 | |
| 2408 | $this->add_responsive_control( |
| 2409 | 'button_margin_hover', |
| 2410 | array( |
| 2411 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2412 | 'type' => Controls_Manager::DIMENSIONS, |
| 2413 | 'size_units' => array( 'px', 'em', '%' ), |
| 2414 | 'selectors' => array( |
| 2415 | '{{WRAPPER}} .premium-gallery-load-more-btn:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2416 | ), |
| 2417 | ) |
| 2418 | ); |
| 2419 | |
| 2420 | $this->add_responsive_control( |
| 2421 | 'premium_gallery_button_padding_hover', |
| 2422 | array( |
| 2423 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2424 | 'type' => Controls_Manager::DIMENSIONS, |
| 2425 | 'size_units' => array( 'px', 'em', '%' ), |
| 2426 | 'selectors' => array( |
| 2427 | '{{WRAPPER}} .premium-gallery-load-more-btn:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2428 | ), |
| 2429 | ) |
| 2430 | ); |
| 2431 | |
| 2432 | $this->end_controls_tab(); |
| 2433 | |
| 2434 | $this->end_controls_tabs(); |
| 2435 | |
| 2436 | $this->end_controls_section(); |
| 2437 | |
| 2438 | $this->start_controls_section( |
| 2439 | 'section_lightbox_style', |
| 2440 | array( |
| 2441 | 'label' => __( 'Lightbox', 'premium-addons-for-elementor' ), |
| 2442 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2443 | 'condition' => array( |
| 2444 | 'premium_gallery_lightbox_type' => 'yes', |
| 2445 | ), |
| 2446 | ) |
| 2447 | ); |
| 2448 | |
| 2449 | $this->add_control( |
| 2450 | 'lightbox_color', |
| 2451 | array( |
| 2452 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2453 | 'type' => Controls_Manager::COLOR, |
| 2454 | 'selectors' => array( |
| 2455 | '#elementor-lightbox-slideshow-{{ID}}, #elementor-lightbox-{{ID}}' => 'background-color: {{VALUE}};', |
| 2456 | ), |
| 2457 | ) |
| 2458 | ); |
| 2459 | |
| 2460 | $this->add_control( |
| 2461 | 'lightbox_ui_color', |
| 2462 | array( |
| 2463 | 'label' => __( 'UI Color', 'premium-addons-for-elementor' ), |
| 2464 | 'type' => Controls_Manager::COLOR, |
| 2465 | 'selectors' => array( |
| 2466 | '#elementor-lightbox-slideshow-{{ID}} .dialog-lightbox-close-button, #elementor-lightbox-{{ID}} .dialog-lightbox-close-button' => 'color: {{VALUE}};', |
| 2467 | '#elementor-lightbox-slideshow-{{ID}} svg, #elementor-lightbox-{{ID}} svg' => 'fill: {{VALUE}}', |
| 2468 | ), |
| 2469 | ) |
| 2470 | ); |
| 2471 | |
| 2472 | $this->add_control( |
| 2473 | 'lightbox_ui_hover_color', |
| 2474 | array( |
| 2475 | 'label' => __( 'UI Hover Color', 'premium-addons-for-elementor' ), |
| 2476 | 'type' => Controls_Manager::COLOR, |
| 2477 | 'selectors' => array( |
| 2478 | '#elementor-lightbox-slideshow-{{ID}} .dialog-lightbox-close-button:hover, #elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover' => 'color: {{VALUE}};', |
| 2479 | '#elementor-lightbox-slideshow-{{ID}} svg:hover, #elementor-lightbox-{{ID}} svg:hover' => 'fill: {{VALUE}}', |
| 2480 | ), |
| 2481 | ) |
| 2482 | ); |
| 2483 | |
| 2484 | $this->end_controls_section(); |
| 2485 | |
| 2486 | $this->update_controls(); |
| 2487 | |
| 2488 | } |
| 2489 | |
| 2490 | /** |
| 2491 | * Filter Cats |
| 2492 | * |
| 2493 | * Formats Category to be inserted in class attribute. |
| 2494 | * |
| 2495 | * @since 2.1.0 |
| 2496 | * @access public |
| 2497 | * |
| 2498 | * @param string $string category slug. |
| 2499 | * |
| 2500 | * @return string $cat_filtered slug filtered. |
| 2501 | */ |
| 2502 | public function filter_cats( $string ) { |
| 2503 | |
| 2504 | $cat_filtered = trim( $string ); |
| 2505 | |
| 2506 | $cat_filtered = mb_strtolower( $cat_filtered ); |
| 2507 | |
| 2508 | if ( strpos( $cat_filtered, 'class' ) || strpos( $cat_filtered, 'src' ) ) { |
| 2509 | $cat_filtered = substr( $cat_filtered, strpos( $cat_filtered, '"' ) + 1 ); |
| 2510 | $cat_filtered = strtok( $cat_filtered, '"' ); |
| 2511 | $cat_filtered = preg_replace( '/[http:.]/', '', $cat_filtered ); |
| 2512 | $cat_filtered = str_replace( '/', '', $cat_filtered ); |
| 2513 | } |
| 2514 | |
| 2515 | $cat_filtered = str_replace( ', ', ',', $cat_filtered ); |
| 2516 | $cat_filtered = preg_replace( '/[\s_`\'‘&@!#%]/', '-', $cat_filtered ); |
| 2517 | $cat_filtered = str_replace( ',', ' ', $cat_filtered ); |
| 2518 | |
| 2519 | return $cat_filtered; |
| 2520 | } |
| 2521 | |
| 2522 | /** |
| 2523 | * Render Filter Tabs on the frontend |
| 2524 | * |
| 2525 | * @since 2.1.0 |
| 2526 | * @access protected |
| 2527 | * |
| 2528 | * @param string $first Class for the first category. |
| 2529 | * @param integer $active_index active category index. |
| 2530 | */ |
| 2531 | protected function render_filter_tabs( $first, $active_index ) { |
| 2532 | |
| 2533 | $settings = $this->get_settings_for_display(); |
| 2534 | |
| 2535 | ?> |
| 2536 | |
| 2537 | <div class="premium-img-gallery-filter"> |
| 2538 | <ul class="premium-gallery-cats-container"> |
| 2539 | <?php if ( 'yes' === $settings['premium_gallery_first_cat_switcher'] ) : ?> |
| 2540 | <li> |
| 2541 | <a href="javascript:;" class="category <?php echo esc_attr( $first ); ?>" data-filter="*"> |
| 2542 | <?php echo wp_kses_post( $settings['premium_gallery_first_cat_label'] ); ?> |
| 2543 | </a> |
| 2544 | </li> |
| 2545 | <?php |
| 2546 | endif; |
| 2547 | foreach ( $settings['premium_gallery_cats_content'] as $index => $category ) { |
| 2548 | if ( ! empty( $category['premium_gallery_img_cat'] ) ) { |
| 2549 | $cat_filtered = $this->filter_cats( $category['premium_gallery_img_cat'] ); |
| 2550 | |
| 2551 | $key = 'premium_grid_category_' . $index; |
| 2552 | |
| 2553 | if ( $active_index === $index ) { |
| 2554 | $this->add_render_attribute( $key, 'class', 'active' ); |
| 2555 | } |
| 2556 | |
| 2557 | $this->add_render_attribute( |
| 2558 | $key, |
| 2559 | 'class', |
| 2560 | array( |
| 2561 | 'category', |
| 2562 | 'elementor-repeater-item-' . $category['_id'], |
| 2563 | ) |
| 2564 | ); |
| 2565 | |
| 2566 | $slug = sprintf( '.%s', $cat_filtered ); |
| 2567 | |
| 2568 | $this->add_render_attribute( $key, 'data-filter', $slug ); |
| 2569 | ?> |
| 2570 | <li> |
| 2571 | <a href="javascript:;" <?php echo wp_kses_post( $this->get_render_attribute_string( $key ) ); ?>> |
| 2572 | <?php echo wp_kses_post( $category['premium_gallery_img_cat'] ); ?> |
| 2573 | </a> |
| 2574 | </li> |
| 2575 | <?php |
| 2576 | } |
| 2577 | } |
| 2578 | ?> |
| 2579 | </ul> |
| 2580 | </div> |
| 2581 | |
| 2582 | <?php |
| 2583 | } |
| 2584 | |
| 2585 | /** |
| 2586 | * Render Grid output on the frontend. |
| 2587 | * |
| 2588 | * Written in PHP and used to generate the final HTML. |
| 2589 | * |
| 2590 | * @since 2.1.0 |
| 2591 | * @access protected |
| 2592 | */ |
| 2593 | protected function render() { |
| 2594 | |
| 2595 | $settings = $this->get_settings_for_display(); |
| 2596 | |
| 2597 | $filter = $settings['premium_gallery_filter']; |
| 2598 | |
| 2599 | $skin = $settings['premium_gallery_img_style']; |
| 2600 | |
| 2601 | $layout = $settings['premium_gallery_img_size_select']; |
| 2602 | |
| 2603 | $lightbox = $settings['premium_gallery_light_box']; |
| 2604 | |
| 2605 | $lightbox_type = $settings['premium_gallery_lightbox_type']; |
| 2606 | |
| 2607 | $show_play = $settings['premium_gallery_video_icon']; |
| 2608 | |
| 2609 | if ( 'yes' === $settings['premium_gallery_responsive_switcher'] ) { |
| 2610 | $min_size = $settings['premium_gallery_min_range'] . 'px'; |
| 2611 | $max_size = $settings['premium_gallery_max_range'] . 'px'; |
| 2612 | } |
| 2613 | |
| 2614 | $category = '*'; |
| 2615 | |
| 2616 | if ( 'yes' === $filter ) { |
| 2617 | |
| 2618 | if ( ! empty( $settings['premium_gallery_active_cat'] ) || 0 === $settings['premium_gallery_active_cat'] ) { |
| 2619 | |
| 2620 | if ( 'yes' !== $settings['premium_gallery_first_cat_switcher'] ) { |
| 2621 | $active_index = $settings['premium_gallery_active_cat']; |
| 2622 | $active_category = $settings['premium_gallery_cats_content'][ $active_index ]['premium_gallery_img_cat']; |
| 2623 | $category = '.' . $this->filter_cats( $active_category ); |
| 2624 | $active_cat_index = $settings['premium_gallery_active_cat']; |
| 2625 | |
| 2626 | } else { |
| 2627 | $active_cat_index = $settings['premium_gallery_active_cat'] - 1; |
| 2628 | } |
| 2629 | } else { |
| 2630 | $active_cat_index = 'yes' === $settings['premium_gallery_first_cat_switcher'] ? -1 : 0; |
| 2631 | } |
| 2632 | |
| 2633 | $is_all_active = ( 0 > $active_cat_index ) ? 'active' : ''; |
| 2634 | |
| 2635 | } |
| 2636 | |
| 2637 | if ( 'original' === $layout ) { |
| 2638 | $layout = 'masonry'; |
| 2639 | } elseif ( 'one_size' === $layout ) { |
| 2640 | $layout = 'fitRows'; |
| 2641 | } |
| 2642 | |
| 2643 | $ltr_mode = 'yes' === $settings['premium_gallery_rtl_mode'] ? false : true; |
| 2644 | |
| 2645 | $shuffle = 'yes' === $settings['premium_gallery_shuffle'] ? true : false; |
| 2646 | |
| 2647 | $shuffle_onload = 'yes' === $settings['premium_gallery_shuffle_onload'] ? 'random' : 'original-order'; |
| 2648 | |
| 2649 | $grid_settings = array( |
| 2650 | 'img_size' => $layout, |
| 2651 | 'filter' => $filter, |
| 2652 | 'theme' => $settings['premium_gallery_lightbox_theme'], |
| 2653 | 'active_cat' => $category, |
| 2654 | 'ltr_mode' => $ltr_mode, |
| 2655 | 'shuffle' => $shuffle, |
| 2656 | 'sort_by' => $shuffle_onload, |
| 2657 | 'skin' => $skin, |
| 2658 | ); |
| 2659 | |
| 2660 | if ( 'yes' === $filter ) { |
| 2661 | $grid_settings['flag'] = ! empty( $settings['url_flag'] ) ? $settings['url_flag'] : 'cat'; |
| 2662 | } |
| 2663 | |
| 2664 | $load_more = 'yes' === $settings['premium_gallery_load_more'] ? true : false; |
| 2665 | |
| 2666 | if ( $load_more ) { |
| 2667 | $minimum = ! empty( $settings['premium_gallery_load_minimum'] ) ? $settings['premium_gallery_load_minimum'] : 6; |
| 2668 | $click_number = ! empty( $settings['premium_gallery_load_click_number'] ) ? $settings['premium_gallery_load_click_number'] : 6; |
| 2669 | |
| 2670 | $grid_settings = array_merge( |
| 2671 | $grid_settings, |
| 2672 | array( |
| 2673 | 'load_more' => $load_more, |
| 2674 | 'minimum' => $minimum, |
| 2675 | 'click_images' => $click_number, |
| 2676 | ) |
| 2677 | ); |
| 2678 | } |
| 2679 | |
| 2680 | if ( 'yes' === $lightbox ) { |
| 2681 | $grid_settings = array_merge( |
| 2682 | $grid_settings, |
| 2683 | array( |
| 2684 | 'light_box' => $lightbox, |
| 2685 | 'lightbox_type' => $lightbox_type, |
| 2686 | 'overlay' => 'yes' === $settings['premium_gallery_overlay_gallery'] ? true : false, |
| 2687 | ) |
| 2688 | ); |
| 2689 | } else { |
| 2690 | $this->add_render_attribute( |
| 2691 | 'grid', |
| 2692 | array( |
| 2693 | 'class' => array( |
| 2694 | 'premium-img-gallery-no-lightbox', |
| 2695 | ), |
| 2696 | ) |
| 2697 | ); |
| 2698 | } |
| 2699 | |
| 2700 | $this->add_render_attribute( |
| 2701 | 'grid', |
| 2702 | array( |
| 2703 | 'id' => 'premium-img-gallery-' . esc_attr( $this->get_id() ), |
| 2704 | 'class' => array( |
| 2705 | 'elementor-invisible', |
| 2706 | 'premium-img-gallery', |
| 2707 | 'premium-img-gallery-' . $layout, |
| 2708 | $settings['premium_gallery_img_effect'], |
| 2709 | ), |
| 2710 | ) |
| 2711 | ); |
| 2712 | |
| 2713 | if ( $show_play ) { |
| 2714 | $this->add_render_attribute( |
| 2715 | 'grid', |
| 2716 | array( |
| 2717 | 'class' => array( |
| 2718 | 'premium-gallery-icon-show', |
| 2719 | ), |
| 2720 | ) |
| 2721 | ); |
| 2722 | } |
| 2723 | |
| 2724 | $this->add_render_attribute( |
| 2725 | 'gallery_container', |
| 2726 | array( |
| 2727 | 'class' => 'premium-gallery-container', |
| 2728 | 'data-settings' => wp_json_encode( $grid_settings ), |
| 2729 | ) |
| 2730 | ); |
| 2731 | |
| 2732 | $this->add_render_attribute( |
| 2733 | 'image_container', |
| 2734 | 'class', |
| 2735 | array( |
| 2736 | 'pa-gallery-img-container', |
| 2737 | ) |
| 2738 | ); |
| 2739 | |
| 2740 | ?> |
| 2741 | |
| 2742 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'grid' ) ); ?>> |
| 2743 | <?php |
| 2744 | if ( 'yes' === $filter ) : |
| 2745 | $this->render_filter_tabs( $is_all_active, $active_cat_index ); |
| 2746 | endif; |
| 2747 | ?> |
| 2748 | |
| 2749 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'gallery_container' ) ); ?>> |
| 2750 | |
| 2751 | <?php if ( 'metro' === $layout ) : ?> |
| 2752 | <div class="grid-sizer"></div> |
| 2753 | <?php |
| 2754 | endif; |
| 2755 | |
| 2756 | foreach ( $settings['premium_gallery_img_content'] as $index => $image ) : |
| 2757 | |
| 2758 | $key = 'gallery_item_' . $index; |
| 2759 | |
| 2760 | $image_id = apply_filters( 'wpml_object_id', $image['premium_gallery_img']['id'], 'elementor_library', true ); |
| 2761 | |
| 2762 | //Check for Image ID, but not for the default Elementor placeholder. |
| 2763 | if( false === strpos( $image['premium_gallery_img']['url'], 'placeholder.png' ) && ! $image['premium_gallery_video'] && ! $image_id ) |
| 2764 | continue; |
| 2765 | |
| 2766 | $image_by_id = get_post( $image_id ); |
| 2767 | |
| 2768 | $alt = ''; |
| 2769 | if ( isset( $image_by_id->post_title ) ) { |
| 2770 | $alt = apply_filters( 'pa_grid_image_alt', get_post( $image_id )->post_title ); |
| 2771 | } |
| 2772 | |
| 2773 | $this->add_render_attribute( |
| 2774 | $key, |
| 2775 | array( |
| 2776 | 'class' => array( |
| 2777 | 'premium-gallery-item', |
| 2778 | 'elementor-repeater-item-' . $image['_id'], |
| 2779 | $this->filter_cats( $image['premium_gallery_img_category'] ), |
| 2780 | ), |
| 2781 | ) |
| 2782 | ); |
| 2783 | |
| 2784 | if ( $load_more && $index > $minimum - 1 ) { |
| 2785 | |
| 2786 | $this->add_render_attribute( $key, 'class', 'premium-gallery-item-hidden' ); |
| 2787 | |
| 2788 | } |
| 2789 | |
| 2790 | if ( $image['premium_gallery_video'] ) { |
| 2791 | $this->add_render_attribute( $key, 'class', 'premium-gallery-video-item' ); |
| 2792 | } |
| 2793 | ?> |
| 2794 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( $key ) ); ?>> |
| 2795 | <div class="pa-gallery-img <?php echo esc_attr( $skin ); ?>" onclick=""> |
| 2796 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'image_container' ) ); ?>> |
| 2797 | <?php |
| 2798 | $video_data = $this->render_grid_item( $image, $index ); |
| 2799 | |
| 2800 | $image['video_link'] = $video_data['link']; |
| 2801 | $image['video_thumb'] = $video_data['thumbnail']; |
| 2802 | if ( 'style3' === $skin ) : |
| 2803 | ?> |
| 2804 | <div class="pa-gallery-icons-wrapper"> |
| 2805 | <div class="pa-gallery-icons-inner-container"> |
| 2806 | <?php $this->render_icons( $image, $index, $alt ); ?> |
| 2807 | </div> |
| 2808 | </div> |
| 2809 | <?php endif; ?> |
| 2810 | </div> |
| 2811 | <?php |
| 2812 | if ( 'style2' !== $skin ) : |
| 2813 | if ( 'default' === $skin || 'style1' === $skin ) : |
| 2814 | ?> |
| 2815 | <div class="pa-gallery-icons-wrapper"> |
| 2816 | <div class="pa-gallery-icons-inner-container"> |
| 2817 | <?php $this->render_icons( $image, $index, $alt ); ?> |
| 2818 | </div> |
| 2819 | </div> |
| 2820 | <?php |
| 2821 | endif; |
| 2822 | $this->render_image_caption( $image ); |
| 2823 | else : |
| 2824 | ?> |
| 2825 | <div class="pa-gallery-icons-caption-container"> |
| 2826 | <div class="pa-gallery-icons-caption-cell"> |
| 2827 | <?php |
| 2828 | $this->render_icons( $image, $index, $alt ); |
| 2829 | $this->render_image_caption( $image ); |
| 2830 | ?> |
| 2831 | </div> |
| 2832 | </div> |
| 2833 | <?php |
| 2834 | endif; |
| 2835 | if ( $image['premium_gallery_video'] ) : |
| 2836 | ?> |
| 2837 | </div> |
| 2838 | </div> |
| 2839 | <?php |
| 2840 | continue; |
| 2841 | endif; |
| 2842 | if ( 'yes' === $image['premium_gallery_link_whole'] ) { |
| 2843 | |
| 2844 | $link_key = 'image_link_' . $index; |
| 2845 | |
| 2846 | $this->add_render_attribute( |
| 2847 | $link_key, |
| 2848 | array( |
| 2849 | 'class' => 'pa-gallery-whole-link', |
| 2850 | ) |
| 2851 | ); |
| 2852 | |
| 2853 | if ( 'url' === $image['premium_gallery_img_link_type'] ) { |
| 2854 | $icon_link = $image['premium_gallery_img_link']; |
| 2855 | } else { |
| 2856 | $icon_link = get_permalink( $image['premium_gallery_img_existing'] ); |
| 2857 | } |
| 2858 | |
| 2859 | if ( ! empty( $icon_link ) ) { |
| 2860 | |
| 2861 | if ( 'url' === $image['premium_gallery_img_link_type'] ) { |
| 2862 | $this->add_link_attributes( $link_key, $icon_link ); |
| 2863 | |
| 2864 | } else { |
| 2865 | $this->add_render_attribute( $link_key, 'href', $icon_link ); |
| 2866 | } |
| 2867 | |
| 2868 | ?> |
| 2869 | <a <?php echo wp_kses_post( $this->get_render_attribute_string( $link_key ) ); ?>> |
| 2870 | <span> |
| 2871 | <?php echo wp_kses_post( $image['premium_gallery_img_name'] ); ?> |
| 2872 | </span> |
| 2873 | </a> |
| 2874 | <?php |
| 2875 | } |
| 2876 | } elseif ( 'yes' === $lightbox ) { |
| 2877 | |
| 2878 | if ( 'yes' === $image['premium_gallery_lightbox_whole'] ) { |
| 2879 | |
| 2880 | $lightbox_key = 'image_lightbox_' . $index; |
| 2881 | |
| 2882 | $this->add_render_attribute( |
| 2883 | $lightbox_key, |
| 2884 | array( |
| 2885 | 'class' => 'pa-gallery-whole-link', |
| 2886 | 'href' => $image['premium_gallery_img']['url'], |
| 2887 | ) |
| 2888 | ); |
| 2889 | |
| 2890 | if ( 'default' !== $lightbox_type ) { |
| 2891 | |
| 2892 | $this->add_render_attribute( |
| 2893 | $lightbox_key, |
| 2894 | array( |
| 2895 | 'data-elementor-open-lightbox' => $lightbox_type, |
| 2896 | 'data-elementor-lightbox-slideshow' => count( $settings['premium_gallery_img_content'] ) > 1 ? $this->get_id() : false, |
| 2897 | ) |
| 2898 | ); |
| 2899 | |
| 2900 | if ( 'yes' === $settings['lightbox_show_title'] ) { |
| 2901 | |
| 2902 | $this->add_render_attribute( $lightbox_key, 'data-elementor-lightbox-title', $alt ); |
| 2903 | |
| 2904 | } |
| 2905 | } else { |
| 2906 | |
| 2907 | $rel = sprintf( 'prettyPhoto[premium-grid-%s]', $this->get_id() ); |
| 2908 | |
| 2909 | $this->add_render_attribute( |
| 2910 | $lightbox_key, |
| 2911 | array( |
| 2912 | 'data-rel' => $rel, |
| 2913 | ) |
| 2914 | ); |
| 2915 | } |
| 2916 | |
| 2917 | ?> |
| 2918 | |
| 2919 | <a <?php echo wp_kses_post( $this->get_render_attribute_string( $lightbox_key ) ); ?>></a> |
| 2920 | |
| 2921 | <?php |
| 2922 | } |
| 2923 | } |
| 2924 | ?> |
| 2925 | </div> |
| 2926 | </div> |
| 2927 | <?php endforeach; ?> |
| 2928 | |
| 2929 | <?php if ( 'yes' === $settings['gradient_layer'] ) : ?> |
| 2930 | <div class="premium-gallery-gradient-layer"></div> |
| 2931 | <?php endif; ?> |
| 2932 | </div> |
| 2933 | |
| 2934 | <?php if ( 'yes' === $settings['premium_gallery_load_more'] ) : ?> |
| 2935 | <div class="premium-gallery-load-more premium-gallery-btn-hidden"> |
| 2936 | <button class="premium-gallery-load-more-btn"> |
| 2937 | <?php echo wp_kses_post( $settings['premium_gallery_load_more_text'] ); ?> |
| 2938 | <div class="premium-loader"></div> |
| 2939 | </button> |
| 2940 | </div> |
| 2941 | <?php endif; ?> |
| 2942 | |
| 2943 | </div> |
| 2944 | |
| 2945 | <?php |
| 2946 | if ( \Elementor\Plugin::instance()->editor->is_edit_mode() ) { |
| 2947 | |
| 2948 | if ( 'metro' !== $settings['premium_gallery_img_size_select'] ) { |
| 2949 | $this->render_editor_script(); |
| 2950 | } |
| 2951 | } |
| 2952 | ?> |
| 2953 | |
| 2954 | <?php if ( 'yes' === $settings['premium_gallery_responsive_switcher'] ) : ?> |
| 2955 | <style> |
| 2956 | @media( min-width: <?php echo esc_attr( $min_size ); ?> ) and ( max-width:<?php echo esc_attr( $max_size ); ?> ) { |
| 2957 | #premium-img-gallery-<?php echo esc_attr( $this->get_id() ); ?> .premium-gallery-caption { |
| 2958 | display: none; |
| 2959 | } |
| 2960 | } |
| 2961 | </style> |
| 2962 | <?php endif; ?> |
| 2963 | |
| 2964 | <?php |
| 2965 | } |
| 2966 | |
| 2967 | /** |
| 2968 | * Render Grid Image |
| 2969 | * |
| 2970 | * Written in PHP and used to generate the final HTML for image. |
| 2971 | * |
| 2972 | * @since 3.6.4 |
| 2973 | * @access protected |
| 2974 | * |
| 2975 | * @param array $item image repeater item. |
| 2976 | * @param integer $index item index. |
| 2977 | */ |
| 2978 | protected function render_grid_item( $item, $index ) { |
| 2979 | |
| 2980 | $settings = $this->get_settings(); |
| 2981 | |
| 2982 | $image_src = $item['premium_gallery_img']['url']; |
| 2983 | $image_id = attachment_url_to_postid( $image_src ); |
| 2984 | |
| 2985 | $is_video = $item['premium_gallery_video']; |
| 2986 | |
| 2987 | $key = 'image_' . $index; |
| 2988 | |
| 2989 | if ( ! empty( $item['premium_gallery_img']['url'] ) ) { |
| 2990 | $settings['image_data'] = Helper_Functions::get_image_data( $image_id, $item['premium_gallery_img']['url'], $settings['thumbnail_size'] ); |
| 2991 | $image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image_data' ); |
| 2992 | } |
| 2993 | |
| 2994 | if ( $is_video ) { |
| 2995 | |
| 2996 | $type = $item['premium_gallery_video_type']; |
| 2997 | |
| 2998 | if ( 'hosted' !== $type ) { |
| 2999 | $embed_params = $this->get_embed_params( $item ); |
| 3000 | $link = Embed::get_embed_url( $item['premium_gallery_video_url'], $embed_params ); |
| 3001 | |
| 3002 | if ( 'youtube' === $type && 'yes' === $item['privacy_mode'] ) { |
| 3003 | $link = str_replace( '.com', '-nocookie.com', $link ); |
| 3004 | } |
| 3005 | |
| 3006 | if ( empty( $image_html ) ) { |
| 3007 | |
| 3008 | $video_props = Embed::get_video_properties( $link ); |
| 3009 | $id = $video_props['video_id']; |
| 3010 | $type = $video_props['provider']; |
| 3011 | $size = ''; |
| 3012 | |
| 3013 | if ( 'youtube' === $type ) { |
| 3014 | $size = $settings['premium_gallery_yt_thumbnail_size']; |
| 3015 | } |
| 3016 | $image_src = Helper_Functions::get_video_thumbnail( $id, $type, $size ); |
| 3017 | |
| 3018 | $image_html = '<img src="' . esc_url( $image_src ) . '">'; |
| 3019 | } |
| 3020 | } else { |
| 3021 | self::$check_self_hosted = true; |
| 3022 | $video_params = $this->get_hosted_params( $item ); |
| 3023 | } |
| 3024 | } |
| 3025 | |
| 3026 | if ( $is_video ) { |
| 3027 | ?> |
| 3028 | <div class="premium-gallery-video-wrap" data-type="<?php echo esc_attr( $item['premium_gallery_video_type'] ); ?>"> |
| 3029 | <?php if ( 'hosted' !== $item['premium_gallery_video_type'] ) : ?> |
| 3030 | <div class="premium-gallery-iframe-wrap" data-src="<?php echo esc_url( $link ); ?>"></div> |
| 3031 | <?php |
| 3032 | else : |
| 3033 | $link = empty( $item['premium_gallery_video_self_url'] ) ? $item['premium_gallery_video_self']['url'] : $item['premium_gallery_video_self_url']; |
| 3034 | ?> |
| 3035 | <video src="<?php echo esc_url( $link ); ?>" <?php echo wp_kses_post( Utils::render_html_attributes( $video_params ) ); ?>></video> |
| 3036 | <?php endif; ?> |
| 3037 | </div> |
| 3038 | <?php } ?> |
| 3039 | <?php echo wp_kses_post( $image_html ); ?> |
| 3040 | <?php |
| 3041 | |
| 3042 | return array( |
| 3043 | 'link' => ( isset( $link ) && ! empty( $link ) ) ? $link : false, |
| 3044 | 'thumbnail' => $image_src, |
| 3045 | ); |
| 3046 | } |
| 3047 | |
| 3048 | /** |
| 3049 | * Render Icons |
| 3050 | * |
| 3051 | * Render Lightbox and URL Icons HTML |
| 3052 | * |
| 3053 | * @since 3.6.4 |
| 3054 | * @access protected |
| 3055 | * |
| 3056 | * @param array $item grid image repeater item. |
| 3057 | * @param integer $index item index. |
| 3058 | * @param string $alt image alternative text. |
| 3059 | */ |
| 3060 | protected function render_icons( $item, $index, $alt ) { |
| 3061 | |
| 3062 | $settings = $this->get_settings_for_display(); |
| 3063 | |
| 3064 | $lightbox_key = 'image_lightbox_' . $index; |
| 3065 | |
| 3066 | $link_key = 'image_link_' . $index; |
| 3067 | |
| 3068 | $href = $item['premium_gallery_img']['url']; |
| 3069 | |
| 3070 | $lightbox = $settings['premium_gallery_light_box']; |
| 3071 | |
| 3072 | $lightbox_type = $settings['premium_gallery_lightbox_type']; |
| 3073 | |
| 3074 | $is_video = $item['premium_gallery_video']; |
| 3075 | |
| 3076 | $id = $this->get_id(); |
| 3077 | |
| 3078 | if ( $is_video ) { |
| 3079 | |
| 3080 | $type = $item['premium_gallery_video_type']; |
| 3081 | |
| 3082 | $this->add_render_attribute( |
| 3083 | $lightbox_key, |
| 3084 | array( |
| 3085 | 'class' => array( |
| 3086 | 'pa-gallery-lightbox-wrap', |
| 3087 | 'pa-gallery-magnific-image', |
| 3088 | 'pa-gallery-video-icon', |
| 3089 | ), |
| 3090 | 'tabindex' => 0, |
| 3091 | ) |
| 3092 | ); |
| 3093 | |
| 3094 | if ( 'yes' === $lightbox ) { |
| 3095 | |
| 3096 | $lightbox_options = array( |
| 3097 | 'privacy' => 'yes', |
| 3098 | ); |
| 3099 | |
| 3100 | if ( 'default' !== $lightbox_type ) { |
| 3101 | |
| 3102 | if ( 1 === count( $settings['premium_gallery_img_content'] ) || self::$check_self_hosted ) { |
| 3103 | $lightbox_options = array( |
| 3104 | 'type' => 'video', |
| 3105 | 'videoType' => $item['premium_gallery_video_type'], |
| 3106 | 'url' => $item['video_link'], |
| 3107 | 'modalOptions' => array( |
| 3108 | 'id' => 'elementor-lightbox-' . $id, |
| 3109 | 'videoAspectRatio' => '169', |
| 3110 | ), |
| 3111 | ); |
| 3112 | |
| 3113 | if ( 'hosted' === $type ) { |
| 3114 | $lightbox_options['videoParams'] = $this->get_hosted_params( $item ); |
| 3115 | } |
| 3116 | } |
| 3117 | |
| 3118 | $this->add_render_attribute( |
| 3119 | $lightbox_key, |
| 3120 | array( |
| 3121 | 'data-elementor-open-lightbox' => 'yes', |
| 3122 | 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ), |
| 3123 | 'data-elementor-lightbox-video' => $item['video_link'], |
| 3124 | ) |
| 3125 | ); |
| 3126 | |
| 3127 | // Make sure videos slideshow is enabled only when there are no self hosted videos |
| 3128 | // Self hosted videos causes issue with slideshow |
| 3129 | if ( ! self::$check_self_hosted ) { |
| 3130 | $this->add_render_attribute( $lightbox_key, 'data-elementor-lightbox-slideshow', count( $settings['premium_gallery_img_content'] ) > 1 ? $this->get_id() : false ); |
| 3131 | } |
| 3132 | } else { |
| 3133 | |
| 3134 | $rel = sprintf( 'prettyPhoto[premium-grid-%s]', $this->get_id() ); |
| 3135 | $link = ( 'hosted' === $type ) ? $item['video_link'] : $item['video_link'] . '&iframe=true'; |
| 3136 | |
| 3137 | $this->add_render_attribute( |
| 3138 | $lightbox_key, |
| 3139 | array( |
| 3140 | 'href' => $link, |
| 3141 | 'data-rel' => $rel, |
| 3142 | ) |
| 3143 | ); |
| 3144 | } |
| 3145 | } |
| 3146 | |
| 3147 | ?> |
| 3148 | <div> |
| 3149 | <a <?php echo wp_kses_post( $this->get_render_attribute_string( $lightbox_key ) ); ?>> |
| 3150 | <span> |
| 3151 | <?php |
| 3152 | Icons_Manager::render_icon( $settings['premium_gallery_videos_icon'], array( 'aria-hidden' => 'true' ) ); |
| 3153 | ?> |
| 3154 | </span> |
| 3155 | </a> |
| 3156 | </div> |
| 3157 | |
| 3158 | <?php |
| 3159 | return; |
| 3160 | } |
| 3161 | |
| 3162 | if ( 'yes' === $lightbox ) { |
| 3163 | |
| 3164 | if ( 'yes' !== $item['premium_gallery_lightbox_whole'] ) { |
| 3165 | |
| 3166 | $this->add_render_attribute( |
| 3167 | $lightbox_key, |
| 3168 | array( |
| 3169 | 'class' => 'pa-gallery-magnific-image', |
| 3170 | 'href' => $href, |
| 3171 | ) |
| 3172 | ); |
| 3173 | |
| 3174 | if ( 'default' !== $lightbox_type ) { |
| 3175 | |
| 3176 | $this->add_render_attribute( |
| 3177 | $lightbox_key, |
| 3178 | array( |
| 3179 | 'data-elementor-open-lightbox' => $lightbox_type, |
| 3180 | 'data-elementor-lightbox-slideshow' => count( $settings['premium_gallery_img_content'] ) > 1 ? $id : false, |
| 3181 | ) |
| 3182 | ); |
| 3183 | |
| 3184 | if ( 'yes' === $settings['lightbox_show_title'] ) { |
| 3185 | |
| 3186 | $this->add_render_attribute( $lightbox_key, 'data-elementor-lightbox-title', $alt ); |
| 3187 | |
| 3188 | } |
| 3189 | } else { |
| 3190 | |
| 3191 | $rel = sprintf( 'prettyPhoto[premium-grid-%s]', $this->get_id() ); |
| 3192 | |
| 3193 | $this->add_render_attribute( |
| 3194 | $lightbox_key, |
| 3195 | array( |
| 3196 | 'data-rel' => $rel, |
| 3197 | ) |
| 3198 | ); |
| 3199 | |
| 3200 | } |
| 3201 | |
| 3202 | ?> |
| 3203 | |
| 3204 | <a <?php echo wp_kses_post( $this->get_render_attribute_string( $lightbox_key ) ); ?>> |
| 3205 | <span> |
| 3206 | <?php |
| 3207 | Icons_Manager::render_icon( $settings['premium_gallery_lightbox_icon'], array( 'aria-hidden' => 'true' ) ); |
| 3208 | ?> |
| 3209 | </span> |
| 3210 | </a> |
| 3211 | <?php |
| 3212 | } |
| 3213 | } |
| 3214 | |
| 3215 | if ( ! empty( $item['premium_gallery_img_link']['url'] ) || ! empty( $item['premium_gallery_img_existing'] ) ) { |
| 3216 | |
| 3217 | if ( 'yes' !== $item['premium_gallery_link_whole'] ) { |
| 3218 | |
| 3219 | $this->add_render_attribute( |
| 3220 | $link_key, |
| 3221 | array( |
| 3222 | 'class' => 'pa-gallery-img-link', |
| 3223 | ) |
| 3224 | ); |
| 3225 | |
| 3226 | if ( 'url' === $item['premium_gallery_img_link_type'] ) { |
| 3227 | $icon_link = $item['premium_gallery_img_link']; |
| 3228 | } else { |
| 3229 | $icon_link = get_permalink( $item['premium_gallery_img_existing'] ); |
| 3230 | } |
| 3231 | |
| 3232 | if ( ! empty( $icon_link ) ) { |
| 3233 | |
| 3234 | if ( 'url' === $item['premium_gallery_img_link_type'] ) { |
| 3235 | $this->add_link_attributes( $link_key, $icon_link ); |
| 3236 | } else { |
| 3237 | $this->add_render_attribute( $link_key, 'href', $icon_link ); |
| 3238 | } |
| 3239 | |
| 3240 | ?> |
| 3241 | <a <?php echo wp_kses_post( $this->get_render_attribute_string( $link_key ) ); ?>> |
| 3242 | <span> |
| 3243 | <?php |
| 3244 | Icons_Manager::render_icon( $settings['premium_gallery_links_icon'], array( 'aria-hidden' => 'true' ) ); |
| 3245 | ?> |
| 3246 | </span> |
| 3247 | </a> |
| 3248 | <?php |
| 3249 | } |
| 3250 | } |
| 3251 | } |
| 3252 | } |
| 3253 | |
| 3254 | /** |
| 3255 | * Render Image Caption |
| 3256 | * |
| 3257 | * Written in PHP to render the final HTML for image title and description |
| 3258 | * |
| 3259 | * @since 3.6.4 |
| 3260 | * @access protected |
| 3261 | * |
| 3262 | * @param array $item image repeater item. |
| 3263 | */ |
| 3264 | protected function render_image_caption( $item ) { |
| 3265 | |
| 3266 | $media_lib = $item['premmium_gallery_img_info']; |
| 3267 | |
| 3268 | if ( 'yes' === $media_lib ) { |
| 3269 | $title = Control_Media::get_image_title( $item['premium_gallery_img'] ); |
| 3270 | |
| 3271 | $description = get_post( $item['premium_gallery_img']['id'] )->post_content; |
| 3272 | } else { |
| 3273 | $title = $item['premium_gallery_img_name']; |
| 3274 | |
| 3275 | $description = $item['premium_gallery_img_desc']; |
| 3276 | } |
| 3277 | |
| 3278 | if ( ! empty( $title ) || ! empty( $description ) ) : |
| 3279 | ?> |
| 3280 | <div class="premium-gallery-caption"> |
| 3281 | |
| 3282 | <?php if ( ! empty( $title ) ) : ?> |
| 3283 | <span class="premium-gallery-img-name"><?php echo wp_kses_post( $title ); ?></span> |
| 3284 | <?php |
| 3285 | endif; |
| 3286 | |
| 3287 | if ( ! empty( $description ) ) : |
| 3288 | ?> |
| 3289 | <p class="premium-gallery-img-desc"><?php echo wp_kses_post( $description ); ?></p> |
| 3290 | <?php endif; ?> |
| 3291 | |
| 3292 | </div> |
| 3293 | <?php |
| 3294 | endif; |
| 3295 | } |
| 3296 | |
| 3297 | /** |
| 3298 | * Get Hosted Videos Parameters |
| 3299 | * |
| 3300 | * @since 3.7.0 |
| 3301 | * @access private |
| 3302 | * |
| 3303 | * @param array $item image repeater item. |
| 3304 | */ |
| 3305 | private function get_hosted_params( $item ) { |
| 3306 | |
| 3307 | $video_params = array(); |
| 3308 | |
| 3309 | if ( $item['premium_gallery_video_controls'] ) { |
| 3310 | $video_params['controls'] = ''; |
| 3311 | } |
| 3312 | |
| 3313 | if ( $item['premium_gallery_video_mute'] ) { |
| 3314 | $video_params['muted'] = 'muted'; |
| 3315 | } |
| 3316 | |
| 3317 | if ( $item['premium_gallery_video_loop'] ) { |
| 3318 | $video_params['loop'] = ''; |
| 3319 | } |
| 3320 | |
| 3321 | if ( 'yes' !== $item['download_button'] ) { |
| 3322 | $video_params['controlsList'] = 'nodownload'; |
| 3323 | } |
| 3324 | |
| 3325 | $video_params['preload'] = 'none'; |
| 3326 | |
| 3327 | return $video_params; |
| 3328 | } |
| 3329 | |
| 3330 | /** |
| 3331 | * Get embeded videos parameters |
| 3332 | * |
| 3333 | * @since 3.7.0 |
| 3334 | * @access private |
| 3335 | * |
| 3336 | * @param array $item image repeater item. |
| 3337 | */ |
| 3338 | private function get_embed_params( $item ) { |
| 3339 | |
| 3340 | $video_params = array(); |
| 3341 | |
| 3342 | $props = Embed::get_video_properties( $item['premium_gallery_video_url'] ); |
| 3343 | |
| 3344 | $video_params['loop'] = $item['premium_gallery_video_loop'] ? '1' : '0'; |
| 3345 | |
| 3346 | $video_params['autoplay'] = '1'; |
| 3347 | |
| 3348 | $video_params['controls'] = $item['premium_gallery_video_controls'] ? '1' : '0'; |
| 3349 | |
| 3350 | $key = 'youtube' === $item['premium_gallery_video_type'] ? 'mute' : 'muted'; |
| 3351 | |
| 3352 | // $video_params['playlist'] = $props['video_id']; |
| 3353 | |
| 3354 | $video_params[ $key ] = $item['premium_gallery_video_mute'] ? '1' : '0'; |
| 3355 | |
| 3356 | if ( 'vimeo' === $item['premium_gallery_video_type'] ) { |
| 3357 | $video_params['autopause'] = '0'; |
| 3358 | } |
| 3359 | |
| 3360 | return $video_params; |
| 3361 | } |
| 3362 | |
| 3363 | /** |
| 3364 | * Update Controls |
| 3365 | * |
| 3366 | * @since 3.8.8 |
| 3367 | * @access private |
| 3368 | */ |
| 3369 | private function update_controls() { |
| 3370 | |
| 3371 | $this->update_responsive_control( |
| 3372 | 'premium_gallery_img_border_radius', |
| 3373 | array( |
| 3374 | 'type' => Controls_Manager::DIMENSIONS, |
| 3375 | 'selectors' => array( |
| 3376 | '{{WRAPPER}} .pa-gallery-img-container, {{WRAPPER}} .pa-gallery-img:not(.style2) .pa-gallery-icons-wrapper, {{WRAPPER}} .pa-gallery-img.style2 .pa-gallery-icons-caption-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 3377 | ), |
| 3378 | |
| 3379 | ) |
| 3380 | ); |
| 3381 | |
| 3382 | $this->update_responsive_control( |
| 3383 | 'premium_gallery_content_border_radius', |
| 3384 | array( |
| 3385 | 'type' => Controls_Manager::DIMENSIONS, |
| 3386 | 'selectors' => array( |
| 3387 | '{{WRAPPER}} .premium-gallery-caption' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 3388 | ), |
| 3389 | |
| 3390 | ) |
| 3391 | ); |
| 3392 | |
| 3393 | } |
| 3394 | |
| 3395 | /** |
| 3396 | * Render Editor Masonry Script. |
| 3397 | * |
| 3398 | * @since 3.12.3 |
| 3399 | * @access protected |
| 3400 | */ |
| 3401 | protected function render_editor_script() { |
| 3402 | |
| 3403 | ?> |
| 3404 | <script type="text/javascript"> |
| 3405 | jQuery( document ).ready( function( $ ) { |
| 3406 | |
| 3407 | $( '.premium-gallery-container' ).each( function() { |
| 3408 | |
| 3409 | var $node_id = '<?php echo esc_attr( $this->get_id() ); ?>', |
| 3410 | scope = $( '[data-id="' + $node_id + '"]' ), |
| 3411 | settings = $(this).data("settings"), |
| 3412 | selector = $(this); |
| 3413 | |
| 3414 | if ( selector.closest( scope ).length < 1 ) { |
| 3415 | return; |
| 3416 | } |
| 3417 | |
| 3418 | var masonryArgs = { |
| 3419 | // set itemSelector so .grid-sizer is not used in layout |
| 3420 | filter : settings.active_cat, |
| 3421 | itemSelector : '.premium-gallery-item', |
| 3422 | percentPosition : true, |
| 3423 | layoutMode : settings.img_size, |
| 3424 | }; |
| 3425 | |
| 3426 | var $isotopeObj = {}; |
| 3427 | |
| 3428 | selector.imagesLoaded( function() { |
| 3429 | |
| 3430 | $isotopeObj = selector.isotope( masonryArgs ); |
| 3431 | |
| 3432 | selector.find('.premium-gallery-item').resize( function() { |
| 3433 | $isotopeObj.isotope( 'layout' ); |
| 3434 | }); |
| 3435 | }); |
| 3436 | |
| 3437 | }); |
| 3438 | }); |
| 3439 | </script> |
| 3440 | <?php |
| 3441 | } |
| 3442 | } |
| 3443 |