Premium Addons for Elementor - Version 4.4.4

Version Description

  • Fixed: Fixed issue related to self hosted videos in Media Grid widget.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 4.4.4
Comparing to
See all releases

Code changes from version 4.4.3 to 4.4.4

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