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