PluginProbe
WP Directory Kit / 1.5.5
WP Directory Kit v1.5.5
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
wpdirectorykit / elementor-elements / classes / wdk-listing-slider.php

wdk-listing-slider.php in WP Directory Kit 1.5.5, at elementor-elements/classes/wdk-listing-slider.php

944 lines 35.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Wdk\Elementor\Widgets;
4
5 use Wdk\Elementor\Widgets\WdkElementorBase;
6 use Elementor\Widget_Base;
7 use Elementor\Controls_Manager;
8 use Elementor\Utils;
9 use Elementor\Typography;
10 use Elementor\Editor;
11 use Elementor\Plugin;
12 use Elementor\Repeater;
13 use Elementor\Core\Schemes;
14 use Elementor\Icons_Manager;
15 use Elementor\Group_Control_Typography;
16 use Elementor\Group_Control_Border;
17 use Elementor\Group_Control_Box_Shadow;
18
19 if (!defined('ABSPATH'))
20 exit; // Exit if accessed directly
21
22 /**
23 * @since 1.1.0
24 */
25 class WdkListingSlider extends WdkElementorBase {
26
27 public function __construct($data = array(), $args = null) {
28
29 \Elementor\Controls_Manager::add_tab(
30 'tab_conf',
31 esc_html__('Settings', 'wpdirectorykit')
32 );
33
34 \Elementor\Controls_Manager::add_tab(
35 'tab_layout',
36 esc_html__('Layout', 'wpdirectorykit')
37 );
38
39 \Elementor\Controls_Manager::add_tab(
40 'tab_content',
41 esc_html__('Main', 'wpdirectorykit')
42 );
43
44 if ($this->is_edit_mode_load()) {
45 $this->enqueue_styles_scripts();
46 }
47 parent::__construct($data, $args);
48 }
49
50 /**
51 * Retrieve the widget name.
52 *
53 * @since 1.1.0
54 *
55 * @access public
56 *
57 * @return string Widget name.
58 */
59 public function get_name() {
60 return 'wdk-listing-slider';
61 }
62
63 /**
64 * Retrieve the widget title.
65 *
66 * @since 1.1.0
67 *
68 * @access public
69 *
70 * @return string Widget title.
71 */
72 public function get_title() {
73 return esc_html__('Wdk Listing Slider', 'wpdirectorykit');
74 }
75
76 /**
77 * Retrieve the list of categories the widget belongs to.
78 *
79 * Used to determine where to display the widget in the editor.
80 *
81 * Note that currently Elementor supports only one category.
82 * When multiple categories passed, Elementor uses the first one.
83 *
84 * @since 1.1.0
85 *
86 * @access public
87 *
88 * @return array Widget categories.
89 */
90 public function get_categories() {
91 return [ 'wdk-elementor-listing-preview-sliders' ];
92 }
93
94 /**
95 * Retrieve the widget icon.
96 *
97 * @since 1.1.0
98 *
99 * @access public
100 *
101 * @return string Widget icon.
102 */
103 public function get_icon() {
104 return 'eicon-post-navigation';
105 }
106
107 /**
108 * Register the widget controls.
109 *
110 * Adds different input fields to allow the user to change and customize the widget settings.
111 *
112 * @since 1.1.0
113 *
114 * @access protected
115 */
116 protected function register_controls() {
117 $this->generate_controls_conf();
118 $this->generate_controls_layout();
119 $this->generate_controls_styles();
120 $this->generate_controls_content();
121
122 $this->insert_pro_message('tab_conf');
123 parent::register_controls();
124 }
125
126 /**
127 * Render the widget output on the frontend.
128 *
129 * Written in PHP and used to generate the final HTML.
130 *
131 * @since 1.1.0
132 *
133 * @access protected
134 */
135 protected function render() {
136 parent::render();
137 global $wdk_listing_id;
138
139 $this->data['id_element'] = $this->get_id();
140 $this->data['settings'] = $this->get_settings();
141
142 $this->data['plans_exists'] = false;
143 $this->data['images'] = array();
144 $this->data['images_fields'] = array();
145
146 if(!Plugin::$instance->editor->is_edit_mode()) {
147 $this->data['images'] = wdk_listing_images_data (array('listing_images'=>wdk_field_value ('listing_images', $wdk_listing_id)), 'full');
148 $this->data['images'] = array_slice($this->data['images'], ($this->data['settings']['offset_images']-1), $this->data['settings']['limit_images']);
149 } else {
150 $this->data['images'] = array_fill(0, $this->data['settings']['limit_images'], wdk_placeholder_image_src());
151 }
152
153 if(!Plugin::$instance->editor->is_edit_mode() && !empty($this->data['settings']['plans_enable'])) {
154 $plan_images = wdk_listing_images_data(wdk_field_value('listing_plans_documents', $wdk_listing_id), 'full');
155 if (!empty($plan_images) && is_array($plan_images)) {
156 foreach ($plan_images as $k => $v) {
157 $this->data['images']['plans__'.$k] = $v;
158 }
159 $this->data['plans_exists'] = true;
160 }
161 }
162
163 if(!empty($this->data['settings']['gallery_fields'])) {
164 foreach ($this->data['settings']['gallery_fields'] as $key => $field_id) {
165 if(strpos( $field_id,'__') !== FALSE){
166 $field_id = substr( $field_id, strpos($field_id, '__')+2);
167 }
168
169
170 $field_value = wdk_field_value($field_id, $wdk_listing_id);
171 $images = wdk_files_data($field_value, 'full');
172 if (!empty($images) && is_array($images)) {
173 $this->data['images_fields'][$field_id] = $images;
174 foreach ($images as $k => $v) {
175 $this->data['images'][$field_id.'__'.$k] = $v;
176 }
177 }
178 }
179 }
180
181 if(!empty($this->data['settings']['embed_fields'])) {
182 foreach ($this->data['settings']['embed_fields'] as $key => $field_id) {
183 if(strpos( $field_id,'__') !== FALSE){
184 $field_id = substr( $field_id, strpos($field_id, '__')+2);
185 }
186 $images = wdk_field_value($field_id, $wdk_listing_id);
187 if(!empty($images)) {
188 $this->data['images_fields'][$field_id] = $images;
189 }
190 $this->data['images'][$field_id.'__'.$key] = $images;
191 }
192 }
193
194 $this->data['is_edit_mode']= false;
195 if(Plugin::$instance->editor->is_edit_mode()) {
196 $this->data['is_edit_mode']= true;
197 } else {
198 /* return false if no content */
199 }
200
201 echo $this->view('wdk-listing-slider', $this->data);
202 }
203
204
205 private function generate_controls_conf() {
206 $this->start_controls_section(
207 'tab_conf_main_section',
208 [
209 'label' => esc_html__('Main', 'wpdirectorykit'),
210 'tab' => 'tab_conf',
211 ]
212 );
213
214
215 $this->add_control(
216 'popup_enable',
217 [
218 'label' => __( 'Open Images / Video in popup', 'wpdirectorykit' ),
219 'type' => \Elementor\Controls_Manager::SWITCHER,
220 'label_on' => __( 'On', 'wpdirectorykit' ),
221 'label_off' => __( 'Off', 'wpdirectorykit' ),
222 'return_value' => 'yes',
223 'default' => '',
224 ]
225 );
226
227 $this->add_control(
228 'plans_enable',
229 [
230 'label' => __( 'Plans Enable', 'wpdirectorykit' ),
231 'type' => \Elementor\Controls_Manager::SWITCHER,
232 'label_on' => __( 'On', 'wpdirectorykit' ),
233 'label_off' => __( 'Off', 'wpdirectorykit' ),
234 'return_value' => 'yes',
235 'default' => '',
236 ]
237 );
238
239
240
241 $fields_data = wdk_cached_field_get();
242 $fields_list_files = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
243 $fields_list_embed = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
244 $order_i = 0;
245 foreach($fields_data as $field)
246 {
247 if(wmvc_show_data('field_type', $field) == 'FILEUPLOAD') {
248 $fields_list_files[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
249 }
250 if(wmvc_show_data('field_type', $field) == 'INPUTBOX') {
251 $fields_list_embed[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
252 }
253 }
254
255
256 $this->add_control(
257 'gallery_fields',
258 [
259 'label' => __( 'Add Custom Gallery Fields', 'wpdirectorykit' ),
260 'type' => \Elementor\Controls_Manager::SELECT2,
261 'options' => $fields_list_files,
262 'multiple' => true,
263 'default' => [],
264 'label_block' => true,
265 'description' => __( 'Select one or more fields to use as gallery sources.', 'wpdirectorykit' ),
266 ]
267 );
268
269 $this->add_control(
270 'auto_start_video',
271 [
272 'label' => __( 'Auto Start Video', 'wpdirectorykit' ),
273 'type' => \Elementor\Controls_Manager::SWITCHER,
274 'label_on' => __( 'On', 'wpdirectorykit' ),
275 'label_off' => __( 'Off', 'wpdirectorykit' ),
276 'return_value' => 'yes',
277 'default' => '',
278 'description' => __( 'Enable this option to automatically start videos when the slide becomes active.', 'wpdirectorykit' ),
279 ]
280 );
281
282
283 $this->add_control(
284 'embed_fields',
285 [
286 'label' => __( 'Add Embed Fields', 'wpdirectorykit' ),
287 'type' => \Elementor\Controls_Manager::SELECT2,
288 'options' => $fields_list_embed,
289 'multiple' => true,
290 'default' => [],
291 'label_block' => true,
292
293 'description' => __( 'Select one or more fields to use as embed sources.', 'wpdirectorykit' ),
294 ]
295 );
296
297 $this->add_responsive_control(
298 'tabs_direction',
299 [
300 'label' => __( 'Direction Tabs', 'wpdirectorykit' ),
301 'type' => Controls_Manager::SELECT,
302 'options' => [
303 '' => esc_html__('Default', 'wpdirectorykit'),
304 'row' => esc_html__('Row', 'wpdirectorykit'),
305 'row-reverse' => esc_html__('Row reverse', 'wpdirectorykit'),
306 'column' => esc_html__('Column', 'wpdirectorykit'),
307 'column-reverse' => esc_html__('Column reverse', 'wpdirectorykit'),
308 ],
309 'selectors' => [
310 '{{WRAPPER}} .wdk-listing-slider .wdk-listing-slider--tabs' => 'flex-direction: {{UNIT}}',
311 ],
312 'separator' => 'after',
313 ]
314 );
315
316 $this->add_control(
317 'limit_images',
318 [
319 'label' => __( 'Limit Images', 'wpdirectorykit' ),
320 'type' => \Elementor\Controls_Manager::NUMBER,
321 'min' => 1,
322 'max' => 100,
323 'step' => 1,
324 'default' => 10,
325 ]
326 );
327
328 $this->add_control(
329 'offset_images',
330 [
331 'label' => __( 'Offset Images', 'wpdirectorykit' ),
332 'type' => \Elementor\Controls_Manager::NUMBER,
333 'min' => 1,
334 'max' => 100,
335 'step' => 1,
336 'default' => 1,
337 ]
338 );
339
340 $this->add_control(
341 'wdk_listing_video_disabled',
342 [
343 'label' => __( 'Disable Video', 'wpdirectorykit' ),
344 'type' => \Elementor\Controls_Manager::SWITCHER,
345 'label_on' => __( 'True', 'wpdirectorykit' ),
346 'label_off' => __( 'False', 'wpdirectorykit' ),
347 'return_value' => '1',
348 'default' => '',
349 ]
350 );
351
352 $this->end_controls_section();
353
354 }
355
356 private function generate_controls_layout() {
357 $this->start_controls_section(
358 'tab_content',
359 [
360 'label' => esc_html__('Basic', 'wpdirectorykit'),
361 'tab' => 'tab_layout',
362 ]
363 );
364
365 $this->add_responsive_control(
366 'column_gap',
367 [
368 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
369 'type' => Controls_Manager::SLIDER,
370 'default' => [
371 'size' => 10,
372 ],
373 'range' => [
374 'px' => [
375 'min' => 0,
376 'max' => 60,
377 ],
378 ],
379 'selectors' => [
380 '{{WRAPPER}} .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};',
381 '{{WRAPPER}} .wdk-row, {{WRAPPER}} .wdk_listing_slider_ini ' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
382 ],
383 ]
384 );
385
386 $this->end_controls_section();
387
388 $this->start_controls_section(
389 'layout_carousel_sec',
390 [
391 'label' => esc_html__('Carousel Options', 'wpdirectorykit'),
392 'tab' => 'tab_layout',
393 ]
394 );
395
396 $this->add_control(
397 'layout_carousel_is_infinite',
398 [
399 'label' => __( 'Infinite', 'wpdirectorykit' ),
400 'type' => \Elementor\Controls_Manager::SWITCHER,
401 'label_on' => __( 'On', 'wpdirectorykit' ),
402 'label_off' => __( 'Off', 'wpdirectorykit' ),
403 'return_value' => 'true',
404 'default' => 'true',
405 ]
406 );
407
408 $this->add_control(
409 'layout_carousel_is_autoplay',
410 [
411 'label' => __( 'Autoplay', 'wpdirectorykit' ),
412 'type' => \Elementor\Controls_Manager::SWITCHER,
413 'label_on' => __( 'On', 'wpdirectorykit' ),
414 'label_off' => __( 'Off', 'wpdirectorykit' ),
415 'return_value' => 'true',
416 'default' => '',
417 ]
418 );
419
420 $this->add_control(
421 'layout_carousel_speed',
422 [
423 'label' => __( 'Speed', 'wpdirectorykit' ),
424 'type' => \Elementor\Controls_Manager::NUMBER,
425 'min' => 0,
426 'max' => 100000,
427 'step' => 100,
428 'default' => 500,
429 ]
430 );
431
432 $this->add_control(
433 'layout_carousel_animation_style',
434 [
435 'label' => __( 'Animation Style', 'wpdirectorykit' ),
436 'type' => \Elementor\Controls_Manager::SELECT,
437 'default' => 'fade',
438 'options' => [
439 'slide' => __( 'Slide', 'wpdirectorykit' ),
440 'fade' => __( 'Fade', 'wpdirectorykit' ),
441 'fade_in_in' => __( 'Fade in', 'wpdirectorykit' ),
442 ],
443 ]
444 );
445
446 $this->add_control(
447 'layout_carousel_cssease',
448 [
449 'label' => __( 'cssEase', 'wpdirectorykit' ),
450 'type' => \Elementor\Controls_Manager::SELECT,
451 'default' => 'linear',
452 'options' => [
453 'linear' => __( 'linear', 'wpdirectorykit' ),
454 'ease' => __( 'ease', 'wpdirectorykit' ),
455 'ease-in' => __( 'ease-in', 'wpdirectorykit' ),
456 'ease-out' => __( 'ease-out', 'wpdirectorykit' ),
457 'ease-in-out' => __( 'ease-in-out', 'wpdirectorykit' ),
458 'step-start' => __( 'step-start', 'wpdirectorykit' ),
459 'step-end' => __( 'step-end', 'wpdirectorykit' ),
460 ],
461 ]
462 );
463
464 $this->add_control(
465 'layout_carousel_columns',
466 [
467 'label' => __( 'Count grid', 'wpdirectorykit' ),
468 'type' => \Elementor\Controls_Manager::NUMBER,
469 'min' => 1,
470 'max' => 10,
471 'step' => 1,
472 'default' => 1,
473 ]
474 );
475
476 $this->end_controls_section();
477
478 }
479
480 private function generate_controls_styles() {
481 $this->start_controls_section(
482 'styles_thmbn_type',
483 [
484 'label' => esc_html__('Thumbnail', 'wpdirectorykit'),
485 'tab' => Controls_Manager::TAB_STYLE,
486 ]
487 );
488
489 $this->add_control(
490 'layout_image_design',
491 [
492 'label' => __( 'Size style thumbnail', 'wpdirectorykit' ),
493 'type' => \Elementor\Controls_Manager::SELECT,
494 'default' => 'none',
495 'options' => [
496 'none' => __( 'None', 'wpdirectorykit' ),
497 'contain' => __( 'Contain', 'wpdirectorykit' ),
498 'cover' => __( 'Cover', 'wpdirectorykit' ),
499 ],
500 'selectors' => [
501 '{{WRAPPER}} .wdk_listing_slider_box .wdk-listing-image' => 'object-fit: {{VALUE}}',
502 ],
503 ]
504 );
505
506 $selectors = array(
507 'normal' => '{{WRAPPER}} .wdk_listing_slider_box .wdk-listing-image',
508 );
509 $this->generate_renders_tabs($selectors, 'layout_image_dynamic', 'block');
510
511 $this->add_control(
512 'enable_fixed_height',
513 [
514 'label' => __( 'Fixed Height', 'wpdirectorykit' ),
515 'type' => \Elementor\Controls_Manager::SWITCHER,
516 'label_on' => __( 'True', 'wpdirectorykit' ),
517 'label_off' => __( 'False', 'wpdirectorykit' ),
518 'return_value' => 'yes',
519 'default' => 'yes',
520 ]
521 );
522
523 $this->add_responsive_control (
524 'styles_thmbn_des_height',
525 [
526 'label' => esc_html__('Height', 'wpdirectorykit'),
527 'type' => Controls_Manager::SLIDER,
528 'range' => [
529 'px' => [
530 'min' => 100,
531 'max' => 1500,
532 ],
533 'vw' => [
534 'min' => 0,
535 'max' => 100,
536 ],
537 ],
538 'size_units' => [ 'px','em', 'vw', '%', 'custom' ],
539 'default' => [
540 'size' => 350,
541 'unit' => 'px',
542 ],
543 'selectors' => [
544 '{{WRAPPER}} .wdk_listing_slider_box .wdk-listing-image' => 'height: {{SIZE}}{{UNIT}}',
545 ],
546 'separator' => 'after',
547 ]
548 );
549
550 $this->end_controls_section();
551
552 $this->start_controls_section(
553 'styles_thmbn_nav_section',
554 [
555 'label' => esc_html__('Thumbnail Navs', 'wpdirectorykit'),
556 'tab' => Controls_Manager::TAB_STYLE,
557 ]
558 );
559
560 $this->add_responsive_control(
561 'styles_thmbn_nav_section_hide',
562 [
563 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
564 'type' => Controls_Manager::SWITCHER,
565 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
566 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
567 'return_value' => 'none',
568 'default' => '',
569 'selectors' => [
570 '{{WRAPPER}} .banner-thumbs' => 'display: {{VALUE}};',
571 ],
572 ]
573 );
574
575
576 $this->add_responsive_control(
577 'styles_thmbn_nav_columns',
578 [
579 'label' => __( 'Count grid', 'wpdirectorykit' ),
580 'type' => \Elementor\Controls_Manager::NUMBER,
581 'min' => 1,
582 'max' => 10,
583 'step' => 1,
584 'default' => 4,
585 ]
586 );
587
588
589 $selectors = array(
590 'normal' => '{{WRAPPER}} .banner-thumbs .banner-thumb',
591 'hover' => '{{WRAPPER}} .banner-thumbs .banner-thumb%1$s,{{WRAPPER}} .wdk-listing-slider .banner-thumbs-con .banner-thumbs .slick-slide.slick-current.slick-active .banner-thumb',
592 );
593 $this->generate_renders_tabs($selectors, 'layout_image_nav_dynamic', ['border','background','padding','border_radius']);
594
595 $this->add_responsive_control(
596 'styles_thmbn_nav_mask_header',
597 [
598 'label' => esc_html__('Mask', 'wpdirectorykit'),
599 'type' => Controls_Manager::HEADING,
600 'separator' => 'before',
601 ]
602 );
603 $selectors = array(
604 'normal' => '{{WRAPPER}} .wdk-listing-slider .banner-thumbs-con .banner-thumbs .banner-thumb::before',
605 );
606 $this->generate_renders_tabs($selectors, 'styles_thmbn_nav_mask', ['background']);
607
608 $this->add_control(
609 'styles_thmbn_nav_mask_hr',
610 [
611 'type' => \Elementor\Controls_Manager::DIVIDER,
612 ]
613 );
614
615 $this->add_responsive_control (
616 'styles_thmbn_nav_height',
617 [
618 'label' => esc_html__('Height', 'wpdirectorykit'),
619 'type' => Controls_Manager::SLIDER,
620 'range' => [
621 'px' => [
622 'min' => 100,
623 'max' => 1500,
624 ],
625 'vw' => [
626 'min' => 0,
627 'max' => 100,
628 ],
629 ],
630 'size_units' => [ 'px','em', 'vw', '%', 'custom' ],
631 'default' => [
632 'size' => 80,
633 'unit' => 'px',
634 ],
635 'selectors' => [
636 '{{WRAPPER}} .banner-thumbs .banner-thumb' => 'height: {{SIZE}}{{UNIT}}',
637 ],
638 'separator' => 'after',
639 ]
640 );
641
642 $this->add_responsive_control(
643 'styles_thmbn_nav_box',
644 [
645 'label' => esc_html__('Nav container', 'wpdirectorykit'),
646 'type' => Controls_Manager::HEADING,
647 'separator' => 'before',
648 ]
649 );
650 $selectors = array(
651 'normal' => '{{WRAPPER}} .wdk-listing-slider .banner-thumbs-con',
652 );
653 $this->generate_renders_tabs($selectors, 'styles_thmbn_nav_box_styles', ['margin']);
654
655 $this->end_controls_section();
656
657 $items = [
658 [
659 'key'=>'card',
660 'label'=> esc_html__('Slide', 'wpdirectorykit'),
661 'selector'=>'.wdk_listing_slider_box .wdk-listing-image-card',
662 'selector_hover'=>'.wdk_listing_slider_box .wdk-listing-image-card%1$s',
663 'options'=>'block',
664 ],
665 ];
666
667 foreach ($items as $item) {
668 $this->start_controls_section(
669 $item['key'].'_section',
670 [
671 'label' => $item['label'],
672 'tab' => '1',
673 ]
674 );
675
676 $selectors = array(
677 'normal' => '{{WRAPPER}} '.$item['selector'],
678 'hover'=>'{{WRAPPER}} '.$item['selector_hover'],
679 );
680 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
681
682 $this->end_controls_section();
683 }
684
685
686 $this->start_controls_section(
687 'styles_carousel_arrows_section',
688 [
689 'label' => esc_html__('Carousel Arrows', 'wpdirectorykit'),
690 'tab' => '1',
691 ]
692 );
693
694 $this->add_responsive_control(
695 'styles_carousel_arrows_hide',
696 [
697 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
698 'type' => Controls_Manager::SWITCHER,
699 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
700 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
701 'return_value' => 'none',
702 'default' => '',
703 'selectors' => [
704 '{{WRAPPER}} .wdk-listing-slider .wdk-listing-slider_arrows' => 'display: {{VALUE}};',
705 ],
706 ]
707 );
708
709 $this->add_responsive_control(
710 'styles_carousel_arrows_position',
711 [
712 'label' => __( 'Position', 'wpdirectorykit' ),
713 'type' => \Elementor\Controls_Manager::SELECT,
714 'default' => 'wdk-listing-slider_arrows_bottom',
715 'options' => [
716 'wdk-listing-slider_arrows_bottom' => __( 'Bottom', 'wpdirectorykit' ),
717 'wdk-listing-slider_arrows_middle' => __( 'Center', 'wpdirectorykit' ),
718 'wdk-listing-slider_arrows_top' => __( 'Top', 'wpdirectorykit' ),
719 ],
720 ]
721 );
722
723 $this->add_responsive_control(
724 'styles_carousel_arrows_position_style',
725 [
726 'label' => __( 'Position Style', 'wpdirectorykit' ),
727 'type' => \Elementor\Controls_Manager::SELECT,
728 'default' => 'wdk-listing-slider_arrows_out',
729 'options' => [
730 'wdk-listing-slider_arrows_out' => __( 'Out', 'wpdirectorykit' ),
731 'wdk-listing-slider_arrows_in' => __( 'In', 'wpdirectorykit' ),
732 ],
733 ]
734 );
735
736 $this->add_responsive_control(
737 'styles_carousel_arrows_align',
738 [
739 'label' => __( 'Align', 'wpdirectorykit' ),
740 'type' => Controls_Manager::CHOOSE,
741 'options' => [
742 'left' => [
743 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
744 'icon' => 'eicon-text-align-left',
745 ],
746 'center' => [
747 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
748 'icon' => 'eicon-text-align-center',
749 ],
750 'right' => [
751 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
752 'icon' => 'eicon-text-align-right',
753 ],
754 'justify' => [
755 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
756 'icon' => 'eicon-text-align-justify',
757 ],
758 ],
759 'render_type' => 'ui',
760 'selectors_dictionary' => [
761 'left' => 'justify-content: flex-start;',
762 'center' => 'justify-content: center;',
763 'right' => 'justify-content: flex-end;',
764 'justify' => 'justify-content: space-between;',
765 ],
766 'selectors' => [
767 '{{WRAPPER}} .wdk-listing-slider .wdk-listing-slider_arrows' => '{{VALUE}};',
768 ],
769 ]
770 );
771
772 $this->add_responsive_control(
773 'styles_carousel_arrows_icon_left_h',
774 [
775 'label' => esc_html__('Arrow left', 'wpdirectorykit'),
776 'type' => Controls_Manager::HEADING,
777 'separator' => 'before',
778 ]
779 );
780 $selectors = array(
781 'normal' => '{{WRAPPER}} .wdk-listing-slider .wdk-listing-slider_arrows .wdk-listing-slider_arrow.wdk_prev',
782 );
783 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_s_m_left', ['margin']);
784
785 $this->add_responsive_control(
786 'styles_carousel_arrows_icon_left',
787 [
788 'label' => esc_html__('Icon', 'wpdirectorykit'),
789 'type' => Controls_Manager::ICONS,
790 'label_block' => true,
791 'default' => [
792 'value' => 'fa fa-angle-left',
793 'library' => 'solid',
794 ],
795 ]
796 );
797
798 $this->add_responsive_control(
799 'styles_carousel_arrows_icon_right_h',
800 [
801 'label' => esc_html__('Arrow right', 'wpdirectorykit'),
802 'type' => Controls_Manager::HEADING,
803 'separator' => 'before',
804 ]
805 );
806 $selectors = array(
807 'normal' => '{{WRAPPER}} .wdk-listing-slider .wdk-listing-slider_arrows .wdk-listing-slider_arrow.wdk_next',
808 );
809 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_s_m_next', ['margin']);
810
811 $this->add_responsive_control(
812 'styles_carousel_arrows_icon_right',
813 [
814 'label' => esc_html__('Icon', 'wpdirectorykit'),
815 'type' => Controls_Manager::ICONS,
816 'label_block' => true,
817 'default' => [
818 'value' => 'fa fa-angle-right',
819 'library' => 'solid',
820 ],
821 ]
822 );
823
824 $selectors = array(
825 'normal' => '{{WRAPPER}} .wdk-listing-slider .wdk-listing-slider_arrows .wdk-listing-slider_arrow',
826 'hover'=>'{{WRAPPER}} .wdk-listing-slider .wdk-listing-slider_arrows .wdk-listing-slider_arrow%1$s'
827 );
828 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_dynamic', ['typo','color','background','border','border_radius','padding','shadow','transition']);
829
830 $this->end_controls_section();
831
832 $this->start_controls_section(
833 'styles_carousel_dots_section',
834 [
835 'label' => esc_html__('Section Dots', 'wpdirectorykit'),
836 'tab' => '1',
837 ]
838 );
839
840 $this->add_responsive_control(
841 'styles_carousel_dots_hide',
842 [
843 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
844 'type' => Controls_Manager::SWITCHER,
845 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
846 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
847 'return_value' => 'none',
848 'default' => '',
849 'selectors' => [
850 '{{WRAPPER}} .wdk-listing-slider .slick-dots' => 'display: {{VALUE}} !important;',
851 ],
852 ]
853 );
854
855 $this->add_responsive_control(
856 'styles_carousel_dots_position_style',
857 [
858 'label' => __( 'Position Style', 'wpdirectorykit' ),
859 'type' => \Elementor\Controls_Manager::SELECT,
860 'default' => 'wdk-listing-slider_dots_out',
861 'options' => [
862 'wdk-listing-slider_dots_out' => __( 'Out', 'wpdirectorykit' ),
863 'wdk-listing-slider_dots_in' => __( 'In', 'wpdirectorykit' ),
864 ],
865 ]
866 );
867
868 $this->add_responsive_control(
869 'styles_carousel_dots_align',
870 [
871 'label' => __( 'Position', 'wpdirectorykit' ),
872 'type' => Controls_Manager::CHOOSE,
873 'options' => [
874 'left' => [
875 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
876 'icon' => 'eicon-text-align-left',
877 ],
878 'center' => [
879 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
880 'icon' => 'eicon-text-align-center',
881 ],
882 'right' => [
883 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
884 'icon' => 'eicon-text-align-right',
885 ],
886 'justify' => [
887 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
888 'icon' => 'eicon-text-align-justify',
889 ],
890 ],
891 'render_type' => 'ui',
892 'selectors_dictionary' => [
893 'left' => 'justify-content: flex-start;',
894 'center' => 'justify-content: center;',
895 'right' => 'justify-content: flex-end;',
896 'justify' => 'justify-content: space-between;',
897 ],
898 'selectors' => [
899 '{{WRAPPER}} .wdk-listing-slider .slick-dots' => '{{VALUE}};',
900 ],
901 ]
902 );
903
904 $this->add_responsive_control(
905 'styles_carousel_dots_icon',
906 [
907 'label' => esc_html__('Icon', 'wpdirectorykit'),
908 'type' => Controls_Manager::ICONS,
909 'label_block' => true,
910 'default' => [
911 'value' => 'fas fa-circle',
912 'library' => 'solid',
913 ],
914 ]
915 );
916
917 $selectors = array(
918 'normal' => '{{WRAPPER}} .wdk-listing-slider .slick-dots li .wdk_dot',
919 'hover'=>'{{WRAPPER}} .wdk-listing-slider .slick-dots li .wdk_dot%1$s'
920 );
921 $this->generate_renders_tabs($selectors, 'styles_carousel_dots_dynamic', 'full', ['align']);
922
923 $this->end_controls_section();
924 }
925
926 private function generate_controls_content() {
927
928 }
929
930 public function enqueue_styles_scripts() {
931 wp_enqueue_style('wdk-listing-slider');
932 wp_enqueue_style('slick');
933 wp_enqueue_style('slick-theme');
934 wp_enqueue_script('slick');
935
936 wp_enqueue_style('wdk-notify');
937 wp_enqueue_script('wdk-notify');
938
939 wp_enqueue_style('blueimp-gallery');
940 wp_enqueue_script('blueimp-gallery');
941 wp_enqueue_script('wdk-blueimp-gallery');
942 }
943 }
944