Premium Addons for Elementor - Version 4.4.1

Version Description

  • Fixed: Lightbox navigation issue with videos in Media Grid widget.
  • Fixed: Blog pagination functions are called even pagination option is disabled.
Download this release

Release Info

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

Code changes from version 4.4.0 to 4.4.1

includes/class-premium-template-tags.php CHANGED
@@ -1059,6 +1059,10 @@ class Premium_Template_Tags {
1059
 
1060
  $settings = self::$settings;
1061
 
 
 
 
 
1062
  $pages = self::$page_limit;
1063
 
1064
  if ( ! empty( $settings['max_pages'] ) ) {
1059
 
1060
  $settings = self::$settings;
1061
 
1062
+ if ( 'yes' !== $settings['premium_blog_paging'] ) {
1063
+ return;
1064
+ }
1065
+
1066
  $pages = self::$page_limit;
1067
 
1068
  if ( ! empty( $settings['max_pages'] ) ) {
premium-addons-for-elementor.php CHANGED
@@ -3,9 +3,9 @@
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.0
7
- Elementor tested up to: 3.2.5
8
- Elementor Pro tested up to: 3.3.1
9
  Author: Leap13
10
  Author URI: https://leap13.com/
11
  Text Domain: premium-addons-for-elementor
@@ -18,12 +18,12 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  }
19
 
20
  // Define Constants.
21
- define( 'PREMIUM_ADDONS_VERSION', '4.4.0' );
22
  define( 'PREMIUM_ADDONS_URL', plugins_url( '/', __FILE__ ) );
23
  define( 'PREMIUM_ADDONS_PATH', plugin_dir_path( __FILE__ ) );
24
  define( 'PREMIUM_ADDONS_FILE', __FILE__ );
25
  define( 'PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
26
- define( 'PREMIUM_ADDONS_STABLE_VERSION', '4.3.9' );
27
 
28
  /*
29
  * Load plugin core 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.1
7
+ Elementor tested up to: 3.3.0
8
+ Elementor Pro tested up to: 3.3.2
9
  Author: Leap13
10
  Author URI: https://leap13.com/
11
  Text Domain: premium-addons-for-elementor
18
  }
19
 
20
  // Define Constants.
21
+ define( 'PREMIUM_ADDONS_VERSION', '4.4.1' );
22
  define( 'PREMIUM_ADDONS_URL', plugins_url( '/', __FILE__ ) );
23
  define( 'PREMIUM_ADDONS_PATH', plugin_dir_path( __FILE__ ) );
24
  define( 'PREMIUM_ADDONS_FILE', __FILE__ );
25
  define( 'PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
26
+ define( 'PREMIUM_ADDONS_STABLE_VERSION', '4.4.0' );
27
 
28
  /*
29
  * Load plugin core 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.7.2
7
  Requires PHP: 5.4
8
- Stable Tag: 4.4.0
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
@@ -13,7 +13,7 @@ Premium Addons for Elementor plugin includes essential widgets and addons like B
13
 
14
  == Description ==
15
 
16
- Supercharge your [Elementor Page Builder](https://wordpress.org/plugins/elementor/) with 55+ highly customizable Elementor essential addons and widgets, 300+ premade Elementor templates that will give you the ability to build sophisticated websites in less time with no coding required. Both Elementor and Premium Addons plugins take your WordPress website to the next level.
17
 
18
  [**Check Elementor Widgets & Addons Demo Pages**](https://premiumaddons.com/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme)
19
 
@@ -195,6 +195,11 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
195
 
196
  == Changelog ==
197
 
 
 
 
 
 
198
  = 4.4.0 =
199
 
200
  - Tweak: Added Flipping Efect in Countdown widget.
5
  Requires at least: 5.0
6
  Tested Up To: 5.7.2
7
  Requires PHP: 5.4
8
+ Stable Tag: 4.4.1
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
13
 
14
  == Description ==
15
 
16
+ Supercharge your [Elementor Page Builder](https://wordpress.org/plugins/elementor/) with 55+ highly customizable Elementor essential addons and widgets, 330+ premade Elementor templates that will give you the ability to build sophisticated websites in less time with no coding required. Both Elementor and Premium Addons plugins take your WordPress website to the next level.
17
 
18
  [**Check Elementor Widgets & Addons Demo Pages**](https://premiumaddons.com/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme)
19
 
195
 
196
  == Changelog ==
197
 
198
+ = 4.4.1 =
199
+
200
+ - Fixed: Lightbox navigation issue with videos in Media Grid widget.
201
+ - Fixed: Blog pagination functions are called even pagination option is disabled.
202
+
203
  = 4.4.0 =
204
 
205
  - Tweak: Added Flipping Efect in Countdown widget.
widgets/premium-grid.php CHANGED
@@ -1,3271 +1,3279 @@
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' => __( 'Minimum 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_link = $this->render_grid_item( $image, $index );
2660
-
2661
- $image['video_link'] = $video_link;
2662
- if ( 'style3' === $skin ) :
2663
- ?>
2664
- <div class="pa-gallery-icons-wrapper">
2665
- <div class="pa-gallery-icons-inner-container">
2666
- <?php $this->render_icons( $image, $index ); ?>
2667
- </div>
2668
- </div>
2669
- <?php endif; ?>
2670
- </div>
2671
- <?php
2672
- if ( 'style2' !== $skin ) :
2673
- if ( 'default' === $skin || 'style1' === $skin ) :
2674
- ?>
2675
- <div class="pa-gallery-icons-wrapper">
2676
- <div class="pa-gallery-icons-inner-container">
2677
- <?php $this->render_icons( $image, $index ); ?>
2678
- </div>
2679
- </div>
2680
- <?php
2681
- endif;
2682
- $this->render_image_caption( $image );
2683
- else :
2684
- ?>
2685
- <div class="pa-gallery-icons-caption-container">
2686
- <div class="pa-gallery-icons-caption-cell">
2687
- <?php
2688
- $this->render_icons( $image, $index );
2689
- $this->render_image_caption( $image );
2690
- ?>
2691
- </div>
2692
- </div>
2693
- <?php
2694
- endif;
2695
- if ( $image['premium_gallery_video'] ) :
2696
- ?>
2697
- </div>
2698
- </div>
2699
- <?php
2700
- continue;
2701
- endif;
2702
- if ( 'yes' === $image['premium_gallery_link_whole'] ) {
2703
-
2704
- if ( 'url' === $image['premium_gallery_img_link_type'] && ! empty( $image['premium_gallery_img_link']['url'] ) ) {
2705
-
2706
- $icon_link = $image['premium_gallery_img_link']['url'];
2707
- $external = $image['premium_gallery_img_link']['is_external'] ? 'target="_blank"' : '';
2708
- $no_follow = $image['premium_gallery_img_link']['nofollow'] ? 'rel="nofollow"' : '';
2709
-
2710
- ?>
2711
- <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>
2712
-
2713
- <?php
2714
- } elseif ( 'link' === $image['premium_gallery_img_link_type'] ) {
2715
- $icon_link = get_permalink( $image['premium_gallery_img_existing'] );
2716
- ?>
2717
- <a class="pa-gallery-whole-link" href="<?php echo esc_attr( $icon_link ); ?>"></a>
2718
- <?php
2719
- }
2720
- } elseif ( 'yes' === $lightbox ) {
2721
-
2722
- if ( 'yes' === $image['premium_gallery_lightbox_whole'] ) {
2723
-
2724
- $lightbox_key = 'image_lightbox_' . $index;
2725
-
2726
- $this->add_render_attribute(
2727
- $lightbox_key,
2728
- array(
2729
- 'class' => 'pa-gallery-whole-link',
2730
- 'href' => $image['premium_gallery_img']['url'],
2731
- )
2732
- );
2733
-
2734
- if ( 'default' !== $lightbox_type ) {
2735
-
2736
- $this->add_render_attribute(
2737
- $lightbox_key,
2738
- array(
2739
- 'data-elementor-open-lightbox' => $lightbox_type,
2740
- 'data-elementor-lightbox-slideshow' => count( $settings['premium_gallery_img_content'] ) > 1 ? $this->get_id() : false,
2741
- )
2742
- );
2743
-
2744
- if ( 'yes' === $settings['lightbox_show_title'] ) {
2745
-
2746
- $alt = Control_Media::get_image_alt( $image['premium_gallery_img'] );
2747
-
2748
- $this->add_render_attribute( $lightbox_key, 'data-elementor-lightbox-title', $alt );
2749
-
2750
- }
2751
- } else {
2752
-
2753
- $rel = sprintf( 'prettyPhoto[premium-grid-%s]', $this->get_id() );
2754
-
2755
- $this->add_render_attribute(
2756
- $lightbox_key,
2757
- array(
2758
- 'data-rel' => $rel,
2759
- )
2760
- );
2761
- }
2762
-
2763
- ?>
2764
-
2765
- <a <?php echo wp_kses_post( $this->get_render_attribute_string( $lightbox_key ) ); ?>></a>
2766
-
2767
- <?php
2768
- }
2769
- }
2770
- ?>
2771
- </div>
2772
- </div>
2773
- <?php endforeach; ?>
2774
-
2775
- <?php if ( 'yes' === $settings['gradient_layer'] ) : ?>
2776
- <div class="premium-gallery-gradient-layer"></div>
2777
- <?php endif; ?>
2778
- </div>
2779
-
2780
- <?php if ( 'yes' === $settings['premium_gallery_load_more'] ) : ?>
2781
- <div class="premium-gallery-load-more premium-gallery-btn-hidden">
2782
- <button class="premium-gallery-load-more-btn">
2783
- <span><?php echo wp_kses_post( $settings['premium_gallery_load_more_text'] ); ?></span>
2784
- <div class="premium-loader"></div>
2785
- </button>
2786
- </div>
2787
- <?php endif; ?>
2788
-
2789
- </div>
2790
-
2791
- <?php
2792
- if ( \Elementor\Plugin::instance()->editor->is_edit_mode() ) {
2793
-
2794
- if ( 'metro' !== $settings['premium_gallery_img_size_select'] ) {
2795
- $this->render_editor_script();
2796
- }
2797
- }
2798
- ?>
2799
-
2800
- <?php if ( 'yes' === $settings['premium_gallery_responsive_switcher'] ) : ?>
2801
- <style>
2802
- @media( min-width: <?php echo esc_attr( $min_size ); ?> ) and ( max-width:<?php echo esc_attr( $max_size ); ?> ) {
2803
- #premium-img-gallery-<?php echo esc_attr( $this->get_id() ); ?> .premium-gallery-caption {
2804
- display: none;
2805
- }
2806
- }
2807
- </style>
2808
- <?php endif; ?>
2809
-
2810
- <?php
2811
- }
2812
-
2813
- /**
2814
- * Render Grid Image
2815
- *
2816
- * Written in PHP and used to generate the final HTML for image.
2817
- *
2818
- * @since 3.6.4
2819
- * @access protected
2820
- *
2821
- * @param array $item image repeater item.
2822
- * @param integer $index item index.
2823
- */
2824
- protected function render_grid_item( $item, $index ) {
2825
-
2826
- $settings = $this->get_settings();
2827
-
2828
- $image_id = attachment_url_to_postid( $item['premium_gallery_img']['url'] );
2829
-
2830
- $settings['image_data'] = Helper_Functions::get_image_data( $image_id, $item['premium_gallery_img']['url'], $settings['thumbnail_size'] );
2831
-
2832
- $is_video = $item['premium_gallery_video'];
2833
-
2834
- $alt = Control_Media::get_image_alt( $item['premium_gallery_img'] );
2835
-
2836
- $key = 'image_' . $index;
2837
-
2838
- $image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image_data' );
2839
-
2840
- if ( $is_video ) {
2841
-
2842
- $type = $item['premium_gallery_video_type'];
2843
-
2844
- if ( 'hosted' !== $type ) {
2845
- $embed_params = $this->get_embed_params( $item );
2846
- $link = Embed::get_embed_url( $item['premium_gallery_video_url'], $embed_params );
2847
-
2848
- if ( empty( $image_html ) ) {
2849
-
2850
- $video_props = Embed::get_video_properties( $link );
2851
- $id = $video_props['video_id'];
2852
- $type = $video_props['provider'];
2853
- $size = '';
2854
- if ( 'youtube' === $type ) {
2855
- $size = $settings['premium_gallery_yt_thumbnail_size'];
2856
- }
2857
- $image_src = Helper_Functions::get_video_thumbnail( $id, $type, $size );
2858
-
2859
- $image_html = '<img src="' . esc_url( $image_src ) . '">';
2860
- }
2861
- } else {
2862
- $video_params = $this->get_hosted_params( $item );
2863
- }
2864
- }
2865
-
2866
- // $this->add_render_attribute(
2867
- // $key,
2868
- // array(
2869
- // 'class' => 'pa-gallery-image',
2870
- // 'src' => $image_src,
2871
- // 'alt' => $alt,
2872
- // )
2873
- // );
2874
-
2875
- if ( $is_video ) {
2876
- ?>
2877
- <div class="premium-gallery-video-wrap" data-type="<?php echo esc_attr( $item['premium_gallery_video_type'] ); ?>">
2878
- <?php if ( 'hosted' !== $item['premium_gallery_video_type'] ) : ?>
2879
- <div class="premium-gallery-iframe-wrap" data-src="<?php echo esc_url( $link ); ?>"></div>
2880
- <?php
2881
- else :
2882
- $link = empty( $item['premium_gallery_video_self_url'] ) ? $item['premium_gallery_video_self']['url'] : $item['premium_gallery_video_self_url'];
2883
- ?>
2884
- <video src="<?php echo esc_url( $link ); ?>" <?php echo wp_kses_post( Utils::render_html_attributes( $video_params ) ); ?>></video>
2885
- <?php endif; ?>
2886
- </div>
2887
- <?php } ?>
2888
- <?php echo $image_html; ?>
2889
- <?php
2890
-
2891
- return ( isset( $link ) && ! empty( $link ) ) ? $link : false;
2892
- }
2893
-
2894
- /**
2895
- * Render Icons
2896
- *
2897
- * Render Lightbox and URL Icons HTML
2898
- *
2899
- * @since 3.6.4
2900
- * @access protected
2901
- *
2902
- * @param array $item grid image repeater item.
2903
- * @param integer $index item index.
2904
- */
2905
- protected function render_icons( $item, $index ) {
2906
-
2907
- $settings = $this->get_settings_for_display();
2908
-
2909
- $lightbox_key = 'image_lightbox_' . $index;
2910
-
2911
- $link_key = 'image_link_' . $index;
2912
-
2913
- $href = $item['premium_gallery_img']['url'];
2914
-
2915
- $lightbox = $settings['premium_gallery_light_box'];
2916
-
2917
- $lightbox_type = $settings['premium_gallery_lightbox_type'];
2918
-
2919
- $is_video = $item['premium_gallery_video'];
2920
-
2921
- $id = $this->get_id();
2922
-
2923
- if ( $is_video ) {
2924
-
2925
- $type = $item['premium_gallery_video_type'];
2926
-
2927
- $this->add_render_attribute(
2928
- $lightbox_key,
2929
- array(
2930
- 'class' => array(
2931
- 'pa-gallery-lightbox-wrap',
2932
- 'pa-gallery-video-icon',
2933
- ),
2934
- )
2935
- );
2936
-
2937
- if ( 'yes' === $lightbox ) {
2938
-
2939
- $lightbox_options = array(
2940
- 'type' => 'video',
2941
- 'videoType' => $item['premium_gallery_video_type'],
2942
- 'url' => $item['video_link'],
2943
- 'modalOptions' => array(
2944
- 'id' => 'elementor-lightbox-' . $id,
2945
- 'videoAspectRatio' => '169',
2946
- ),
2947
- );
2948
-
2949
- if ( 'hosted' === $type ) {
2950
- $lightbox_options['videoParams'] = $this->get_hosted_params( $item );
2951
- }
2952
-
2953
- $this->add_render_attribute(
2954
- $lightbox_key,
2955
- array(
2956
- 'data-elementor-open-lightbox' => 'yes',
2957
- 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ),
2958
- )
2959
- );
2960
-
2961
- }
2962
-
2963
- ?>
2964
- <div <?php echo wp_kses_post( $this->get_render_attribute_string( $lightbox_key ) ); ?>>
2965
- <a class="pa-gallery-magnific-image pa-gallery-video-icon">
2966
- <span>
2967
- <?php
2968
- Icons_Manager::render_icon( $settings['premium_gallery_videos_icon'], array( 'aria-hidden' => 'true' ) );
2969
- ?>
2970
- </span>
2971
- </a>
2972
- </div>
2973
-
2974
- <?php
2975
- return;
2976
- }
2977
-
2978
- if ( 'yes' === $lightbox ) {
2979
-
2980
- if ( 'yes' !== $item['premium_gallery_lightbox_whole'] ) {
2981
-
2982
- $this->add_render_attribute(
2983
- $lightbox_key,
2984
- array(
2985
- 'class' => 'pa-gallery-magnific-image',
2986
- 'href' => $href,
2987
- )
2988
- );
2989
-
2990
- if ( 'default' !== $lightbox_type ) {
2991
-
2992
- $this->add_render_attribute(
2993
- $lightbox_key,
2994
- array(
2995
- 'data-elementor-open-lightbox' => $lightbox_type,
2996
- 'data-elementor-lightbox-slideshow' => count( $settings['premium_gallery_img_content'] ) > 1 ? $id : false,
2997
- )
2998
- );
2999
-
3000
- if ( 'yes' === $settings['lightbox_show_title'] ) {
3001
-
3002
- $alt = Control_Media::get_image_alt( $item['premium_gallery_img'] );
3003
-
3004
- $this->add_render_attribute( $lightbox_key, 'data-elementor-lightbox-title', $alt );
3005
-
3006
- }
3007
- } else {
3008
-
3009
- $rel = sprintf( 'prettyPhoto[premium-grid-%s]', $this->get_id() );
3010
-
3011
- $this->add_render_attribute(
3012
- $lightbox_key,
3013
- array(
3014
- 'data-rel' => $rel,
3015
- )
3016
- );
3017
-
3018
- }
3019
-
3020
- ?>
3021
-
3022
- <a <?php echo wp_kses_post( $this->get_render_attribute_string( $lightbox_key ) ); ?>>
3023
- <span>
3024
- <?php
3025
- Icons_Manager::render_icon( $settings['premium_gallery_lightbox_icon'], array( 'aria-hidden' => 'true' ) );
3026
- ?>
3027
- </span>
3028
- </a>
3029
- <?php
3030
- }
3031
- }
3032
-
3033
- if ( ! empty( $item['premium_gallery_img_link']['url'] ) || ! empty( $item['premium_gallery_img_existing'] ) ) {
3034
-
3035
- if ( 'yes' !== $item['premium_gallery_link_whole'] ) {
3036
-
3037
- $icon_link = '';
3038
-
3039
- $this->add_render_attribute(
3040
- $link_key,
3041
- array(
3042
- 'class' => 'pa-gallery-img-link',
3043
- )
3044
- );
3045
-
3046
- if ( 'url' === $item['premium_gallery_img_link_type'] && ! empty( $item['premium_gallery_img_link']['url'] ) ) {
3047
-
3048
- $icon_link = $item['premium_gallery_img_link']['url'];
3049
-
3050
- $external = $item['premium_gallery_img_link']['is_external'] ? '_blank' : '';
3051
-
3052
- $no_follow = $item['premium_gallery_img_link']['nofollow'] ? 'nofollow' : '';
3053
-
3054
- $this->add_render_attribute(
3055
- $link_key,
3056
- array(
3057
- 'href' => $icon_link,
3058
- 'target' => $external,
3059
- 'rel' => $no_follow,
3060
- )
3061
- );
3062
-
3063
- } elseif ( 'link' === $item['premium_gallery_img_link_type'] && ! empty( $item['premium_gallery_img_existing'] ) ) {
3064
-
3065
- $icon_link = get_permalink( $item['premium_gallery_img_existing'] );
3066
-
3067
- $this->add_render_attribute(
3068
- $link_key,
3069
- array(
3070
- 'href' => $icon_link,
3071
- )
3072
- );
3073
-
3074
- }
3075
-
3076
- if ( ! empty( $icon_link ) ) {
3077
- ?>
3078
- <a <?php echo wp_kses_post( $this->get_render_attribute_string( $link_key ) ); ?>>
3079
- <span>
3080
- <?php
3081
- Icons_Manager::render_icon( $settings['premium_gallery_links_icon'], array( 'aria-hidden' => 'true' ) );
3082
- ?>
3083
- </span>
3084
- </a>
3085
- <?php
3086
- }
3087
- }
3088
- }
3089
- }
3090
-
3091
- /**
3092
- * Render Image Caption
3093
- *
3094
- * Written in PHP to render the final HTML for image title and description
3095
- *
3096
- * @since 3.6.4
3097
- * @access protected
3098
- *
3099
- * @param array $item image repeater item.
3100
- */
3101
- protected function render_image_caption( $item ) {
3102
-
3103
- $media_lib = $item['premmium_gallery_img_info'];
3104
-
3105
- if ( 'yes' === $media_lib ) {
3106
- $title = Control_Media::get_image_title( $item['premium_gallery_img'] );
3107
-
3108
- $description = get_post( $item['premium_gallery_img']['id'] )->post_content;
3109
- } else {
3110
- $title = $item['premium_gallery_img_name'];
3111
-
3112
- $description = $item['premium_gallery_img_desc'];
3113
- }
3114
-
3115
- if ( ! empty( $title ) || ! empty( $description ) ) :
3116
- ?>
3117
- <div class="premium-gallery-caption">
3118
-
3119
- <?php if ( ! empty( $title ) ) : ?>
3120
- <span class="premium-gallery-img-name"><?php echo wp_kses_post( $title ); ?></span>
3121
- <?php
3122
- endif;
3123
-
3124
- if ( ! empty( $description ) ) :
3125
- ?>
3126
- <p class="premium-gallery-img-desc"><?php echo wp_kses_post( $description ); ?></p>
3127
- <?php endif; ?>
3128
-
3129
- </div>
3130
- <?php
3131
- endif;
3132
- }
3133
-
3134
- /**
3135
- * Get Hosted Videos Parameters
3136
- *
3137
- * @since 3.7.0
3138
- * @access private
3139
- *
3140
- * @param array $item image repeater item.
3141
- */
3142
- private function get_hosted_params( $item ) {
3143
-
3144
- $video_params = array();
3145
-
3146
- if ( $item['premium_gallery_video_controls'] ) {
3147
- $video_params['controls'] = '';
3148
- }
3149
-
3150
- if ( $item['premium_gallery_video_mute'] ) {
3151
- $video_params['muted'] = 'muted';
3152
- }
3153
-
3154
- if ( $item['premium_gallery_video_loop'] ) {
3155
- $video_params['loop'] = '';
3156
- }
3157
-
3158
- return $video_params;
3159
- }
3160
-
3161
- /**
3162
- * Get embeded videos parameters
3163
- *
3164
- * @since 3.7.0
3165
- * @access private
3166
- *
3167
- * @param array $item image repeater item.
3168
- */
3169
- private function get_embed_params( $item ) {
3170
-
3171
- $video_params = array();
3172
-
3173
- $props = Embed::get_video_properties( $item['premium_gallery_video_url'] );
3174
-
3175
- $video_params['loop'] = $item['premium_gallery_video_loop'] ? '1' : '0';
3176
-
3177
- $video_params['controls'] = $item['premium_gallery_video_controls'] ? '1' : '0';
3178
-
3179
- $key = 'youtube' === $item['premium_gallery_video_type'] ? 'mute' : 'muted';
3180
-
3181
- $video_params['playlist'] = $props['video_id'];
3182
-
3183
- $video_params[ $key ] = $item['premium_gallery_video_mute'] ? '1' : '0';
3184
-
3185
- if ( 'vimeo' === $item['premium_gallery_video_type'] ) {
3186
- $video_params['autopause'] = '0';
3187
- }
3188
-
3189
- return $video_params;
3190
- }
3191
-
3192
- /**
3193
- * Update Controls
3194
- *
3195
- * @since 3.8.8
3196
- * @access private
3197
- */
3198
- private function update_controls() {
3199
-
3200
- $this->update_responsive_control(
3201
- 'premium_gallery_img_border_radius',
3202
- array(
3203
- 'type' => Controls_Manager::DIMENSIONS,
3204
- 'selectors' => array(
3205
- '{{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}}',
3206
- ),
3207
-
3208
- )
3209
- );
3210
-
3211
- $this->update_responsive_control(
3212
- 'premium_gallery_content_border_radius',
3213
- array(
3214
- 'type' => Controls_Manager::DIMENSIONS,
3215
- 'selectors' => array(
3216
- '{{WRAPPER}} .premium-gallery-caption' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3217
- ),
3218
-
3219
- )
3220
- );
3221
-
3222
- }
3223
-
3224
- /**
3225
- * Render Editor Masonry Script.
3226
- *
3227
- * @since 3.12.3
3228
- * @access protected
3229
- */
3230
- protected function render_editor_script() {
3231
-
3232
- ?>
3233
- <script type="text/javascript">
3234
- jQuery( document ).ready( function( $ ) {
3235
-
3236
- $( '.premium-gallery-container' ).each( function() {
3237
-
3238
- var $node_id = '<?php echo esc_attr( $this->get_id() ); ?>',
3239
- scope = $( '[data-id="' + $node_id + '"]' ),
3240
- settings = $(this).data("settings"),
3241
- selector = $(this);
3242
-
3243
- if ( selector.closest( scope ).length < 1 ) {
3244
- return;
3245
- }
3246
-
3247
- var masonryArgs = {
3248
- // set itemSelector so .grid-sizer is not used in layout
3249
- filter : settings.active_cat,
3250
- itemSelector : '.premium-gallery-item',
3251
- percentPosition : true,
3252
- layoutMode : settings.img_size,
3253
- };
3254
-
3255
- var $isotopeObj = {};
3256
-
3257
- selector.imagesLoaded( function() {
3258
-
3259
- $isotopeObj = selector.isotope( masonryArgs );
3260
-
3261
- selector.find('.premium-gallery-item').resize( function() {
3262
- $isotopeObj.isotope( 'layout' );
3263
- });
3264
- });
3265
-
3266
- });
3267
- });
3268
- </script>
3269
- <?php
3270
- }
3271
- }
 
 
 
 
 
 
 
 
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' => __( 'Minimum 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
+ // 'type' => 'video',
2946
+ // 'videoType' => $item['premium_gallery_video_type'],
2947
+ // 'url' => $item['video_link'],
2948
+ // 'modalOptions' => array(
2949
+ // 'id' => 'elementor-lightbox-' . $id,
2950
+ // 'videoAspectRatio' => '169',
2951
+ // ),
2952
+ // );
2953
+
2954
+ if ( 'hosted' === $type ) {
2955
+ $lightbox_options['videoParams'] = $this->get_hosted_params( $item );
2956
+ }
2957
+
2958
+ $this->add_render_attribute(
2959
+ $lightbox_key,
2960
+ array(
2961
+ 'data-elementor-open-lightbox' => 'yes',
2962
+ // 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ),
2963
+ 'data-elementor-lightbox-slideshow' => count( $settings['premium_gallery_img_content'] ) > 1 ? $this->get_id() : false,
2964
+ 'href' => $item['video_thumb'],
2965
+ 'data-elementor-lightbox-video' => $item['video_link'],
2966
+ )
2967
+ );
2968
+
2969
+ }
2970
+
2971
+ ?>
2972
+ <div>
2973
+ <a class="pa-gallery-magnific-image pa-gallery-video-icon" <?php echo wp_kses_post( $this->get_render_attribute_string( $lightbox_key ) ); ?>>
2974
+ <span>
2975
+ <?php
2976
+ Icons_Manager::render_icon( $settings['premium_gallery_videos_icon'], array( 'aria-hidden' => 'true' ) );
2977
+ ?>
2978
+ </span>
2979
+ </a>
2980
+ </div>
2981
+
2982
+ <?php
2983
+ return;
2984
+ }
2985
+
2986
+ if ( 'yes' === $lightbox ) {
2987
+
2988
+ if ( 'yes' !== $item['premium_gallery_lightbox_whole'] ) {
2989
+
2990
+ $this->add_render_attribute(
2991
+ $lightbox_key,
2992
+ array(
2993
+ 'class' => 'pa-gallery-magnific-image',
2994
+ 'href' => $href,
2995
+ )
2996
+ );
2997
+
2998
+ if ( 'default' !== $lightbox_type ) {
2999
+
3000
+ $this->add_render_attribute(
3001
+ $lightbox_key,
3002
+ array(
3003
+ 'data-elementor-open-lightbox' => $lightbox_type,
3004
+ 'data-elementor-lightbox-slideshow' => count( $settings['premium_gallery_img_content'] ) > 1 ? $id : false,
3005
+ )
3006
+ );
3007
+
3008
+ if ( 'yes' === $settings['lightbox_show_title'] ) {
3009
+
3010
+ $alt = Control_Media::get_image_alt( $item['premium_gallery_img'] );
3011
+
3012
+ $this->add_render_attribute( $lightbox_key, 'data-elementor-lightbox-title', $alt );
3013
+
3014
+ }
3015
+ } else {
3016
+
3017
+ $rel = sprintf( 'prettyPhoto[premium-grid-%s]', $this->get_id() );
3018
+
3019
+ $this->add_render_attribute(
3020
+ $lightbox_key,
3021
+ array(
3022
+ 'data-rel' => $rel,
3023
+ )
3024
+ );
3025
+
3026
+ }
3027
+
3028
+ ?>
3029
+
3030
+ <a <?php echo wp_kses_post( $this->get_render_attribute_string( $lightbox_key ) ); ?>>
3031
+ <span>
3032
+ <?php
3033
+ Icons_Manager::render_icon( $settings['premium_gallery_lightbox_icon'], array( 'aria-hidden' => 'true' ) );
3034
+ ?>
3035
+ </span>
3036
+ </a>
3037
+ <?php
3038
+ }
3039
+ }
3040
+
3041
+ if ( ! empty( $item['premium_gallery_img_link']['url'] ) || ! empty( $item['premium_gallery_img_existing'] ) ) {
3042
+
3043
+ if ( 'yes' !== $item['premium_gallery_link_whole'] ) {
3044
+
3045
+ $icon_link = '';
3046
+
3047
+ $this->add_render_attribute(
3048
+ $link_key,
3049
+ array(
3050
+ 'class' => 'pa-gallery-img-link',
3051
+ )
3052
+ );
3053
+
3054
+ if ( 'url' === $item['premium_gallery_img_link_type'] && ! empty( $item['premium_gallery_img_link']['url'] ) ) {
3055
+
3056
+ $icon_link = $item['premium_gallery_img_link']['url'];
3057
+
3058
+ $external = $item['premium_gallery_img_link']['is_external'] ? '_blank' : '';
3059
+
3060
+ $no_follow = $item['premium_gallery_img_link']['nofollow'] ? 'nofollow' : '';
3061
+
3062
+ $this->add_render_attribute(
3063
+ $link_key,
3064
+ array(
3065
+ 'href' => $icon_link,
3066
+ 'target' => $external,
3067
+ 'rel' => $no_follow,
3068
+ )
3069
+ );
3070
+
3071
+ } elseif ( 'link' === $item['premium_gallery_img_link_type'] && ! empty( $item['premium_gallery_img_existing'] ) ) {
3072
+
3073
+ $icon_link = get_permalink( $item['premium_gallery_img_existing'] );
3074
+
3075
+ $this->add_render_attribute(
3076
+ $link_key,
3077
+ array(
3078
+ 'href' => $icon_link,
3079
+ )
3080
+ );
3081
+
3082
+ }
3083
+
3084
+ if ( ! empty( $icon_link ) ) {
3085
+ ?>
3086
+ <a <?php echo wp_kses_post( $this->get_render_attribute_string( $link_key ) ); ?>>
3087
+ <span>
3088
+ <?php
3089
+ Icons_Manager::render_icon( $settings['premium_gallery_links_icon'], array( 'aria-hidden' => 'true' ) );
3090
+ ?>
3091
+ </span>
3092
+ </a>
3093
+ <?php
3094
+ }
3095
+ }
3096
+ }
3097
+ }
3098
+
3099
+ /**
3100
+ * Render Image Caption
3101
+ *
3102
+ * Written in PHP to render the final HTML for image title and description
3103
+ *
3104
+ * @since 3.6.4
3105
+ * @access protected
3106
+ *
3107
+ * @param array $item image repeater item.
3108
+ */
3109
+ protected function render_image_caption( $item ) {
3110
+
3111
+ $media_lib = $item['premmium_gallery_img_info'];
3112
+
3113
+ if ( 'yes' === $media_lib ) {
3114
+ $title = Control_Media::get_image_title( $item['premium_gallery_img'] );
3115
+
3116
+ $description = get_post( $item['premium_gallery_img']['id'] )->post_content;
3117
+ } else {
3118
+ $title = $item['premium_gallery_img_name'];
3119
+
3120
+ $description = $item['premium_gallery_img_desc'];
3121
+ }
3122
+
3123
+ if ( ! empty( $title ) || ! empty( $description ) ) :
3124
+ ?>
3125
+ <div class="premium-gallery-caption">
3126
+
3127
+ <?php if ( ! empty( $title ) ) : ?>
3128
+ <span class="premium-gallery-img-name"><?php echo wp_kses_post( $title ); ?></span>
3129
+ <?php
3130
+ endif;
3131
+
3132
+ if ( ! empty( $description ) ) :
3133
+ ?>
3134
+ <p class="premium-gallery-img-desc"><?php echo wp_kses_post( $description ); ?></p>
3135
+ <?php endif; ?>
3136
+
3137
+ </div>
3138
+ <?php
3139
+ endif;
3140
+ }
3141
+
3142
+ /**
3143
+ * Get Hosted Videos Parameters
3144
+ *
3145
+ * @since 3.7.0
3146
+ * @access private
3147
+ *
3148
+ * @param array $item image repeater item.
3149
+ */
3150
+ private function get_hosted_params( $item ) {
3151
+
3152
+ $video_params = array();
3153
+
3154
+ if ( $item['premium_gallery_video_controls'] ) {
3155
+ $video_params['controls'] = '';
3156
+ }
3157
+
3158
+ if ( $item['premium_gallery_video_mute'] ) {
3159
+ $video_params['muted'] = 'muted';
3160
+ }
3161
+
3162
+ if ( $item['premium_gallery_video_loop'] ) {
3163
+ $video_params['loop'] = '';
3164
+ }
3165
+
3166
+ return $video_params;
3167
+ }
3168
+
3169
+ /**
3170
+ * Get embeded videos parameters
3171
+ *
3172
+ * @since 3.7.0
3173
+ * @access private
3174
+ *
3175
+ * @param array $item image repeater item.
3176
+ */
3177
+ private function get_embed_params( $item ) {
3178
+
3179
+ $video_params = array();
3180
+
3181
+ $props = Embed::get_video_properties( $item['premium_gallery_video_url'] );
3182
+
3183
+ $video_params['loop'] = $item['premium_gallery_video_loop'] ? '1' : '0';
3184
+
3185
+ $video_params['controls'] = $item['premium_gallery_video_controls'] ? '1' : '0';
3186
+
3187
+ $key = 'youtube' === $item['premium_gallery_video_type'] ? 'mute' : 'muted';
3188
+
3189
+ $video_params['playlist'] = $props['video_id'];
3190
+
3191
+ $video_params[ $key ] = $item['premium_gallery_video_mute'] ? '1' : '0';
3192
+
3193
+ if ( 'vimeo' === $item['premium_gallery_video_type'] ) {
3194
+ $video_params['autopause'] = '0';
3195
+ }
3196
+
3197
+ return $video_params;
3198
+ }
3199
+
3200
+ /**
3201
+ * Update Controls
3202
+ *
3203
+ * @since 3.8.8
3204
+ * @access private
3205
+ */
3206
+ private function update_controls() {
3207
+
3208
+ $this->update_responsive_control(
3209
+ 'premium_gallery_img_border_radius',
3210
+ array(
3211
+ 'type' => Controls_Manager::DIMENSIONS,
3212
+ 'selectors' => array(
3213
+ '{{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}}',
3214
+ ),
3215
+
3216
+ )
3217
+ );
3218
+
3219
+ $this->update_responsive_control(
3220
+ 'premium_gallery_content_border_radius',
3221
+ array(
3222
+ 'type' => Controls_Manager::DIMENSIONS,
3223
+ 'selectors' => array(
3224
+ '{{WRAPPER}} .premium-gallery-caption' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3225
+ ),
3226
+
3227
+ )
3228
+ );
3229
+
3230
+ }
3231
+
3232
+ /**
3233
+ * Render Editor Masonry Script.
3234
+ *
3235
+ * @since 3.12.3
3236
+ * @access protected
3237
+ */
3238
+ protected function render_editor_script() {
3239
+
3240
+ ?>
3241
+ <script type="text/javascript">
3242
+ jQuery( document ).ready( function( $ ) {
3243
+
3244
+ $( '.premium-gallery-container' ).each( function() {
3245
+
3246
+ var $node_id = '<?php echo esc_attr( $this->get_id() ); ?>',
3247
+ scope = $( '[data-id="' + $node_id + '"]' ),
3248
+ settings = $(this).data("settings"),
3249
+ selector = $(this);
3250
+
3251
+ if ( selector.closest( scope ).length < 1 ) {
3252
+ return;
3253
+ }
3254
+
3255
+ var masonryArgs = {
3256
+ // set itemSelector so .grid-sizer is not used in layout
3257
+ filter : settings.active_cat,
3258
+ itemSelector : '.premium-gallery-item',
3259
+ percentPosition : true,
3260
+ layoutMode : settings.img_size,
3261
+ };
3262
+
3263
+ var $isotopeObj = {};
3264
+
3265
+ selector.imagesLoaded( function() {
3266
+
3267
+ $isotopeObj = selector.isotope( masonryArgs );
3268
+
3269
+ selector.find('.premium-gallery-item').resize( function() {
3270
+ $isotopeObj.isotope( 'layout' );
3271
+ });
3272
+ });
3273
+
3274
+ });
3275
+ });
3276
+ </script>
3277
+ <?php
3278
+ }
3279
+ }