PluginProbe
WP Directory Kit / 1.2.7
WP Directory Kit v1.2.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 1.4.0 1.4.1 All 35 releases
wpdirectorykit / elementor-elements / classes / wdk-locations-carousel.php

wdk-locations-carousel.php in WP Directory Kit 1.2.7, at elementor-elements/classes/wdk-locations-carousel.php

1,045 lines 42.0 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 WdkLocationsCarousel 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
48 parent::__construct($data, $args);
49 }
50
51 /**
52 * Retrieve the widget name.
53 *
54 * @since 1.1.0
55 *
56 * @access public
57 *
58 * @return string Widget name.
59 */
60 public function get_name() {
61 return 'wdk-locations-carousel';
62 }
63
64 /**
65 * Retrieve the widget title.
66 *
67 * @since 1.1.0
68 *
69 * @access public
70 *
71 * @return string Widget title.
72 */
73 public function get_title() {
74 return esc_html__('Wdk Locations Carousel', 'wpdirectorykit');
75 }
76
77 /**
78 * Retrieve the widget icon.
79 *
80 * @since 1.1.0
81 *
82 * @access public
83 *
84 * @return string Widget icon.
85 */
86 public function get_icon() {
87 return 'eicon-banner';
88 }
89
90 /**
91 * Register the widget controls.
92 *
93 * Adds different input fields to allow the user to change and customize the widget settings.
94 *
95 * @since 1.1.0
96 *
97 * @access protected
98 */
99 protected function register_controls() {
100 $this->generate_controls_conf();
101 $this->generate_controls_layout();
102 $this->generate_controls_styles();
103 $this->generate_controls_content();
104
105 $this->insert_pro_message('1');
106 parent::register_controls();
107 }
108
109 /**
110 * Render the widget output on the frontend.
111 *
112 * Written in PHP and used to generate the final HTML.
113 *
114 * @since 1.1.0
115 *
116 * @access protected
117 */
118 protected function render() {
119 parent::render();
120
121 $this->data['id_element'] = $this->get_id();
122 $this->data['settings'] = $this->get_settings();
123
124 $controller = 'location';
125 $this->WMVC->model($controller.'_m');
126 $this->WMVC->model('listing_m');
127 $this->data['results'] = array();
128
129 if($this->data['settings']['conf_results_type'] == 'custom_locations') {
130
131 $locations_ids = array();
132 foreach($this->data['settings']['conf_custom_results'] as $location) {
133 if(isset($location['location_id']) && !empty($location['location_id'])) {
134 $locations_ids [] = $location['location_id'];
135 }
136 }
137
138 /* where in */
139 if(!empty($locations_ids)){
140
141 $this->WMVC->db->select($this->WMVC->{$controller.'_m'}->_table_name.'.*, COUNT('.$this->WMVC->listing_m->_table_name.'.post_id) AS listings_counter');
142 $this->WMVC->db->join($this->WMVC->listing_m->_table_name.' ON '.$this->WMVC->listing_m->_table_name.'.location_id = '.$this->WMVC->{$controller.'_m'}->_table_name.'.idlocation', TRUE, 'LEFT');
143 $this->WMVC->db->where($this->WMVC->{$controller.'_m'}->_table_name.'.idlocation IN(' . implode(',', $locations_ids) . ')', null, false);
144 $this->WMVC->db->order_by('FIELD('.$this->WMVC->{$controller.'_m'}->_table_name.'.idlocation, '. implode(',', $locations_ids) . ')');
145 $this->WMVC->db->group_by($this->WMVC->{$controller.'_m'}->_primary_key);
146
147 $this->data['results'] = $this->WMVC->{$controller.'_m'}->get();
148 }
149
150 } else {
151 $order_by = NULL;
152 if(!empty($this->data['settings']['conf_order_by']))
153 $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
154
155 $where = array();
156 if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
157 $where['('.$this->WMVC->{$controller.'_m'}->_table_name.'.level = 0)'] = NULL;
158 }
159 $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination($this->data['settings']['conf_limit'], NULL, $where, $order_by);
160 }
161
162 $this->data['is_edit_mode']= false;
163 if(Plugin::$instance->editor->is_edit_mode())
164 $this->data['is_edit_mode']= true;
165
166 echo $this->view('wdk-locations-carousel', $this->data);
167 }
168
169 private function generate_controls_conf() {
170 $this->start_controls_section(
171 'tab_conf_main_section',
172 [
173 'label' => esc_html__('Main', 'wpdirectorykit'),
174 'tab' => '1',
175 ]
176 );
177
178 $pages = array('' => __('Not Selected', 'wpdirectorykit'));
179 foreach(get_pages(array('sort_column' => 'post_title')) as $page)
180 {
181 $pages[$page->ID] = $page->post_title.' #'.$page->ID;
182 }
183
184 $this->add_control(
185 'conf_link',
186 [
187 'label' => __( 'Open results on page', 'wpdirectorykit' ),
188 'type' => \Elementor\Controls_Manager::SELECT,
189 'default' => '',
190 'options' => $pages
191 ]
192 );
193
194 $this->add_control(
195 'conf_results_type',
196 [
197 'label' => __( 'Show type', 'wpdirectorykit' ),
198 'type' => \Elementor\Controls_Manager::SELECT,
199 'default' => 'results_locations',
200 'options' => [
201 'results_locations' => __( 'All Locations', 'wpdirectorykit' ),
202 'custom_locations' => __( 'Specific', 'wpdirectorykit' ),
203 ],
204 'separator' => 'after',
205 ]
206 );
207
208 $this->add_control(
209 'important_note',
210 [
211 'label' => '',
212 'type' => \Elementor\Controls_Manager::RAW_HTML,
213 'raw' => wdk_sprintf(__( 'Manage Locations <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_location')),
214 'content_classes' => 'wdk_elementor_hint',
215 ]
216 );
217
218 $this->add_responsive_control(
219 'only_root_enable',
220 [
221 'label' => esc_html__( 'Show only Root', 'wpdirectorykit' ),
222 'type' => Controls_Manager::SWITCHER,
223 'none' => esc_html__( 'No', 'wpdirectorykit' ),
224 'block' => esc_html__( 'Yes', 'wpdirectorykit' ),
225 'return_value' => 'yes',
226 'default' => 'yes',
227 ]
228 );
229 $this->add_control(
230 'conf_limit',
231 [
232 'label' => __( 'Limit Locations', 'wpdirectorykit' ),
233 'type' => \Elementor\Controls_Manager::NUMBER,
234 'min' => 1,
235 'max' => 50,
236 'step' => 1,
237 'default' => 6,
238 'conditions' => [
239 'terms' => [
240 [
241 'name' => 'conf_results_type',
242 'operator' => '==',
243 'value' => 'results_locations',
244 ]
245 ],
246 ],
247 ]
248 );
249
250 $this->add_control(
251 'conf_order_by',
252 [
253 'label' => __('Order By Column', 'wpdirectorykit'),
254 'type' => Controls_Manager::SELECT,
255 'label_block' => true,
256 'options' => [
257 '' => __('None', 'wpdirectorykit'),
258 'location_title' => __('Title', 'wpdirectorykit'),
259 'idlocation' => __('Category id', 'wpdirectorykit'),
260 'order_index' => __('Order index', 'wpdirectorykit'),
261 'listings_counter' => __('Most Listings', 'wpdirectorykit'),
262 ],
263 'default' => 'order_index',
264 'conditions' => [
265 'terms' => [
266 [
267 'name' => 'conf_results_type',
268 'operator' => '==',
269 'value' => 'results_locations',
270 ]
271 ],
272 ],
273 ]
274 );
275
276 $this->add_control(
277 'conf_order',
278 [
279 'label' => __('Order', 'wpdirectorykit'),
280 'type' => Controls_Manager::SELECT,
281 'label_block' => true,
282 'options' => [
283 'asc' => __('Ascending', 'wpdirectorykit'),
284 'desc' => __('Descending', 'wpdirectorykit')
285 ],
286 'default' => 'asc',
287 'conditions' => [
288 'terms' => [
289 [
290 'name' => 'conf_results_type',
291 'operator' => '==',
292 'value' => 'results_locations',
293 ]
294 ],
295 ],
296 ]
297 );
298
299
300 $this->add_control(
301 'complete_link_enable',
302 [
303 'label' => __( 'Complete Link', 'wpdirectorykit' ),
304 'type' => \Elementor\Controls_Manager::SWITCHER,
305 'label_on' => __( 'On', 'wpdirectorykit' ),
306 'label_off' => __( 'Off', 'wpdirectorykit' ),
307 'return_value' => 'yes',
308 'default' => '',
309 ]
310 );
311
312 if(true){
313 $repeater = new Repeater();
314 $repeater->start_controls_tabs( 'locations' );
315 $repeater->add_control(
316 'location_id',
317 [
318 'label' => __( 'ID Category', 'wpdirectorykit' ),
319 'type' => \Elementor\Controls_Manager::NUMBER,
320 'min' => 1,
321 'step' => 1,
322 ]
323 );
324 $repeater->end_controls_tabs();
325
326
327 $this->add_control(
328 'conf_custom_results',
329 [
330 'type' => Controls_Manager::REPEATER,
331 'fields' => $repeater->get_controls(),
332 'default' => [
333 ],
334 'title_field' => '{{{ location_id }}}',
335 'conditions' => [
336 'terms' => [
337 [
338 'name' => 'conf_results_type',
339 'operator' => '==',
340 'value' => 'custom_locations',
341 ]
342 ],
343 ],
344 ]
345 );
346
347 }
348
349 $this->end_controls_section();
350
351 }
352
353 private function generate_controls_layout() {
354
355 /* START Section t_options_slider */
356 if(true){
357 $this->start_controls_section(
358 'tab_options_slider',
359 [
360 'label' => esc_html__('Slider options', 'wpdirectorykit'),
361 'tab' => 'tab_options',
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' => 0,
372 ],
373 'range' => [
374 'px' => [
375 'min' => 0,
376 'max' => 60,
377 ],
378 ],
379 'selectors' => [
380 '{{WRAPPER}} .slick-slide' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
381 ],
382 ]
383 );
384
385 $this->add_responsive_control(
386 'custom_width',
387 [
388 'label' => esc_html__('Columns Custom Width', 'wpdirectorykit'),
389 'type' => Controls_Manager::SLIDER,
390 'default' => [
391 'size' => '',
392 ],
393 'range' => [
394 'px' => [
395 'min' => 0,
396 'max' => 1200,
397 ],
398 ],
399 'selectors' => [
400 '{{WRAPPER}} .slick-slide .wdk-slider-item' => 'width: {{SIZE}}{{UNIT}} !important;',
401 ],
402 ]
403 );
404
405 $this->add_control(
406 'layout_carousel_center',
407 [
408 'label' => __( 'Center', 'wpdirectorykit' ),
409 'type' => \Elementor\Controls_Manager::SWITCHER,
410 'label_on' => __( 'On', 'wpdirectorykit' ),
411 'label_off' => __( 'Off', 'wpdirectorykit' ),
412 'return_value' => 'yes',
413 'default' => '',
414 ]
415 );
416
417 $this->add_control(
418 'layout_carousel_variableWidth',
419 [
420 'label' => __( 'variableWidth', 'wpdirectorykit' ),
421 'type' => \Elementor\Controls_Manager::SWITCHER,
422 'label_on' => __( 'On', 'wpdirectorykit' ),
423 'label_off' => __( 'Off', 'wpdirectorykit' ),
424 'return_value' => 'yes',
425 'default' => '',
426 ]
427 );
428
429 $this->add_control(
430 'layout_carousel_is_infinite',
431 [
432 'label' => __( 'Infinite', 'wpdirectorykit' ),
433 'type' => \Elementor\Controls_Manager::SWITCHER,
434 'label_on' => __( 'On', 'wpdirectorykit' ),
435 'label_off' => __( 'Off', 'wpdirectorykit' ),
436 'return_value' => 'true',
437 'default' => 'true',
438 ]
439 );
440
441 $this->add_control(
442 'layout_carousel_is_autoplay',
443 [
444 'label' => __( 'Autoplay', 'wpdirectorykit' ),
445 'type' => \Elementor\Controls_Manager::SWITCHER,
446 'label_on' => __( 'On', 'wpdirectorykit' ),
447 'label_off' => __( 'Off', 'wpdirectorykit' ),
448 'return_value' => 'true',
449 'default' => '',
450 ]
451 );
452
453 $this->add_control(
454 'layout_carousel_columns',
455 [
456 'label' => __( 'Count grid', 'wpdirectorykit' ),
457 'type' => \Elementor\Controls_Manager::NUMBER,
458 'min' => 1,
459 'max' => 10,
460 'step' => 1,
461 'default' => 1,
462 ]
463 );
464
465 $this->add_control(
466 'layout_carousel_speed',
467 [
468 'label' => __( 'Speed', 'wpdirectorykit' ),
469 'type' => \Elementor\Controls_Manager::NUMBER,
470 'min' => 0,
471 'max' => 100000,
472 'step' => 100,
473 'default' => 500,
474 ]
475 );
476 $this->add_control(
477 'layout_carousel_autoplaySpeed',
478 [
479 'label' => __( 'Speed', 'wpdirectorykit' ),
480 'type' => \Elementor\Controls_Manager::NUMBER,
481 'min' => 0,
482 'max' => 100000,
483 'step' => 100,
484 'default' => 500,
485 ]
486 );
487
488 $this->add_control(
489 'layout_carousel_animation_style',
490 [
491 'label' => __( 'Animation Style', 'wpdirectorykit' ),
492 'type' => \Elementor\Controls_Manager::SELECT,
493 'default' => 'fade',
494 'options' => [
495 'slide' => __( 'Slide', 'wpdirectorykit' ),
496 'fade' => __( 'Fade', 'wpdirectorykit' ),
497 'fade_in_in' => __( 'Fade in', 'wpdirectorykit' ),
498 ],
499 ]
500 );
501
502 $this->add_control(
503 'layout_carousel_cssease',
504 [
505 'label' => __( 'cssEase', 'wpdirectorykit' ),
506 'type' => \Elementor\Controls_Manager::SELECT,
507 'default' => 'linear',
508 'options' => [
509 'linear' => __( 'linear', 'wpdirectorykit' ),
510 'ease' => __( 'ease', 'wpdirectorykit' ),
511 'ease-in' => __( 'ease-in', 'wpdirectorykit' ),
512 'ease-out' => __( 'ease-out', 'wpdirectorykit' ),
513 'ease-in-out' => __( 'ease-in-out', 'wpdirectorykit' ),
514 'step-start' => __( 'step-start', 'wpdirectorykit' ),
515 'step-end' => __( 'step-end', 'wpdirectorykit' ),
516 ],
517 ]
518 );
519
520 $this->end_controls_section();
521 }
522
523 /* START Section t_options_slider */
524 if(true){
525 $this->start_controls_section(
526 'tab_styles_image',
527 [
528 'label' => esc_html__('Section Image', 'wpdirectorykit'),
529 'tab' => Controls_Manager::TAB_STYLE,
530 ]
531 );
532
533 $this->add_responsive_control(
534 't_styles_img_des_type',
535 [
536 'label' => __( 'Design type', 'wpdirectorykit' ),
537 'type' => \Elementor\Controls_Manager::SELECT,
538 'default' => 'wdk-image_cover',
539 'options' => [
540 '' => __( 'Default Sizes', 'wpdirectorykit' ),
541 'wdk-image_size_cover' => __( 'Image auto crop/resize', 'wpdirectorykit' ),
542 'wdk-image_cover' => __( 'Image cover (like background)', 'wpdirectorykit' ),
543 ],
544 ]
545 );
546
547 $this->add_responsive_control(
548 't_styles_img_des_height',
549 [
550 'label' => esc_html__('Height', 'wpdirectorykit'),
551 'type' => Controls_Manager::SLIDER,
552 'range' => [
553 'px' => [
554 'min' => 300,
555 'max' => 1500,
556 ],
557 ],
558 'render_type' => 'template',
559 'default' => [
560 'size' => 350,
561 ],
562 'selectors' => [
563 '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini.wdk-image_cover .slick-list,
564 {{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini.wdk-image_size_cover .wdk-slider-item .wdk-slider-item_thumbnail' => 'height: {{SIZE}}px',
565 ],
566 'separator' => 'after',
567 'conditions' => [
568 'relation' => 'or',
569 'terms' => [
570 [
571 'name' => 't_styles_img_des_type',
572 'operator' => '==',
573 'value' => 'wdk-image_size_cover',
574 ],
575 [
576 'name' => 't_styles_img_des_type',
577 'operator' => '==',
578 'value' => 'wdk-image_cover',
579 ]
580 ],
581 ]
582 ]
583 );
584 $this->end_controls_section();
585
586 $this->start_controls_section(
587 'tab_styles_arrows_section',
588 [
589 'label' => esc_html__('Section Arrows', 'wpdirectorykit'),
590 'tab' => Controls_Manager::TAB_STYLE,
591 ]
592 );
593
594 $this->add_responsive_control(
595 't_styles_arrows_hide',
596 [
597 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
598 'type' => Controls_Manager::SWITCHER,
599 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
600 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
601 'return_value' => 'none',
602 'default' => '',
603 'selectors' => [
604 '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_arrows' => 'display: {{VALUE}};',
605 ],
606 ]
607 );
608
609
610 $this->add_responsive_control(
611 't_styles_arrows_position',
612 [
613 'label' => __( 'Position', 'wpdirectorykit' ),
614 'type' => \Elementor\Controls_Manager::SELECT,
615 'default' => 'wdk-locations-carousel_arrows_bottom',
616 'options' => [
617 'wdk-locations-carousel_arrows_bottom' => __( 'Bottom', 'wpdirectorykit' ),
618 'wdk-locations-carousel_arrows_middle' => __( 'Center', 'wpdirectorykit' ),
619 'wdk-locations-carousel_arrows_top' => __( 'Top', 'wpdirectorykit' ),
620 ],
621 ]
622 );
623
624 $this->add_responsive_control(
625 't_styles_arrows_position_style',
626 [
627 'label' => __( 'Position Style', 'wpdirectorykit' ),
628 'type' => \Elementor\Controls_Manager::SELECT,
629 'default' => 'wdk-locations-carousel_arrows_out',
630 'options' => [
631 'wdk-locations-carousel_arrows_out' => __( 'Out', 'wpdirectorykit' ),
632 'wdk-locations-carousel_arrows_in' => __( 'In', 'wpdirectorykit' ),
633 ],
634 ]
635 );
636
637 $this->add_responsive_control(
638 't_styles_arrows_align',
639 [
640 'label' => __( 'Align', 'wpdirectorykit' ),
641 'type' => Controls_Manager::CHOOSE,
642 'options' => [
643 'left' => [
644 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
645 'icon' => 'eicon-text-align-left',
646 ],
647 'center' => [
648 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
649 'icon' => 'eicon-text-align-center',
650 ],
651 'right' => [
652 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
653 'icon' => 'eicon-text-align-right',
654 ],
655 'justify' => [
656 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
657 'icon' => 'eicon-text-align-justify',
658 ],
659 ],
660 'render_type' => 'template',
661 'selectors_dictionary' => [
662 'left' => 'justify-content: flex-start;',
663 'center' => 'justify-content: center;',
664 'right' => 'justify-content: flex-end;',
665 'justify' => 'justify-content: space-between;',
666 ],
667 'selectors' => [
668 '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_arrows' => '{{VALUE}};',
669 ],
670 'conditions' => [
671 'relation' => 'or',
672 'terms' => [
673 [
674 'name' => 't_styles_img_des_type',
675 'operator' => '==',
676 'value' => 'wdk-image_size_cover',
677 ],
678 [
679 'name' => 't_styles_img_des_type',
680 'operator' => '==',
681 'value' => 'wdk-image_cover',
682 ]
683 ],
684 ],
685 ]
686 );
687
688 $this->add_responsive_control(
689 'styles_carousel_arrows_icon_left_h',
690 [
691 'label' => esc_html__('Arrow left', 'wpdirectorykit'),
692 'type' => Controls_Manager::HEADING,
693 'separator' => 'before',
694 ]
695 );
696 $selectors = array(
697 'normal' => '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_arrows .wdk-locations-carousel_arrow.wdk-slider-prev',
698 );
699 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_icon_left', ['margin']);
700
701 $this->add_responsive_control(
702 'styles_carousel_arrows_icon_left',
703 [
704 'label' => esc_html__('Icon', 'wpdirectorykit'),
705 'type' => Controls_Manager::ICONS,
706 'label_block' => true,
707 'default' => [
708 'value' => 'fa fa-angle-left',
709 'library' => 'solid',
710 ],
711 ]
712 );
713
714 $this->add_responsive_control(
715 'styles_carousel_arrows_icon_right_h',
716 [
717 'label' => esc_html__('Arrow right', 'wpdirectorykit'),
718 'type' => Controls_Manager::HEADING,
719 'separator' => 'before',
720 ]
721 );
722 $selectors = array(
723 'normal' => '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_arrows .wdk-locations-carousel_arrow.wdk-slider-next',
724 );
725 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_icon_right', ['margin']);
726
727 $this->add_responsive_control(
728 'styles_carousel_arrows_icon_right',
729 [
730 'label' => esc_html__('Icon', 'wpdirectorykit'),
731 'type' => Controls_Manager::ICONS,
732 'label_block' => true,
733 'default' => [
734 'value' => 'fa fa-angle-right',
735 'library' => 'solid',
736 ],
737 ]
738 );
739
740 $selectors = array(
741 'normal' => '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_arrows .wdk-locations-carousel_arrow',
742 'hover'=>'{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_arrows .wdk-locations-carousel_arrow%1$s'
743 );
744 $this->generate_renders_tabs($selectors, 't_styles_arrows_s', ['typo','color','background','border','border_radius','padding','shadow','transition']);
745
746 $this->end_controls_section();
747
748 $this->start_controls_section(
749 'tab_styles_dots_section',
750 [
751 'label' => esc_html__('Section Dots', 'wpdirectorykit'),
752 'tab' => Controls_Manager::TAB_STYLE,
753 ]
754 );
755
756 $this->add_responsive_control(
757 't_styles_dots_hide',
758 [
759 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
760 'type' => Controls_Manager::SWITCHER,
761 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
762 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
763 'return_value' => 'none',
764 'default' => '',
765 'selectors' => [
766 '{{WRAPPER}} .wdk-locations-carousel .slick-dots' => 'display: {{VALUE}} !important;',
767 ],
768 ]
769 );
770
771 $this->add_responsive_control(
772 't_styles_dots_position_style',
773 [
774 'label' => __( 'Position Style', 'wpdirectorykit' ),
775 'type' => \Elementor\Controls_Manager::SELECT,
776 'default' => 'wdk-locations-carousel_dots_out',
777 'options' => [
778 'wdk-locations-carousel_dots_out' => __( 'Out', 'wpdirectorykit' ),
779 'wdk-locations-carousel_dots_in' => __( 'In', 'wpdirectorykit' ),
780 ],
781 ]
782 );
783
784 $this->add_responsive_control(
785 't_styles_dots_align',
786 [
787 'label' => __( 'Position', 'wpdirectorykit' ),
788 'type' => Controls_Manager::CHOOSE,
789 'options' => [
790 'left' => [
791 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
792 'icon' => 'eicon-text-align-left',
793 ],
794 'center' => [
795 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
796 'icon' => 'eicon-text-align-center',
797 ],
798 'right' => [
799 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
800 'icon' => 'eicon-text-align-right',
801 ],
802 'justify' => [
803 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
804 'icon' => 'eicon-text-align-justify',
805 ],
806 ],
807 'render_type' => 'template',
808 'selectors_dictionary' => [
809 'left' => 'justify-content: flex-start;',
810 'center' => 'justify-content: center;',
811 'right' => 'justify-content: flex-end;',
812 'justify' => 'justify-content: space-between;',
813 ],
814 'selectors' => [
815 '{{WRAPPER}} .wdk-locations-carousel .slick-dots' => '{{VALUE}};',
816 ],
817 ]
818 );
819
820 $this->add_responsive_control(
821 'styles_carousel_dots_position_style',
822 [
823 'label' => esc_html__('Icon', 'wpdirectorykit'),
824 'type' => Controls_Manager::ICONS,
825 'label_block' => true,
826 'default' => [
827 'value' => 'fas fa-circle',
828 'library' => 'solid',
829 ],
830 ]
831 );
832
833 $selectors = array(
834 'normal' => '{{WRAPPER}} .wdk-locations-carousel .slick-dots li .wdk-dot',
835 'hover'=>'{{WRAPPER}} .wdk-locations-carousel .slick-dots li .wdk-dot%1$s'
836 );
837 $this->generate_renders_tabs($selectors, 't_styles_dots__s', 'full', ['align']);
838
839 $this->end_controls_section();
840
841 }
842
843 }
844
845 private function generate_controls_styles() {
846
847 }
848
849 private function generate_controls_content() {
850
851 if(true){
852 $this->start_controls_section(
853 'tab_content',
854 [
855 'label' => esc_html__('Basic', 'wpdirectorykit'),
856 'tab' => 'tab_content',
857 ]
858 );
859
860 $this->add_responsive_control(
861 't_content_basic_position_y',
862 [
863 'label' => __( 'Position Y', 'wpdirectorykit' ),
864 'type' => Controls_Manager::CHOOSE,
865 'options' => [
866 'top' => [
867 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
868 'icon' => 'eicon-text-align-left',
869 ],
870 'center' => [
871 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
872 'icon' => 'eicon-text-align-center',
873 ],
874 'bottom' => [
875 'title' => esc_html__( 'Bottom', 'wpdirectorykit' ),
876 'icon' => 'eicon-text-align-right',
877 ],
878 'justify' => [
879 'title' => esc_html__( 'Default', 'wpdirectorykit' ),
880 'icon' => 'eicon-text-align-justify',
881 ],
882 ],
883 'default' => 'left',
884 'render_type' => 'template',
885 'selectors_dictionary' => [
886 'top' => 'justify-content: flex-start;',
887 'center' => 'justify-content: center;',
888 'bottom' => 'justify-content: flex-end;',
889 'justify' => 'justify-content: space-between;',
890 ],
891 'selectors' => [
892 '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item' => '{{VALUE}};',
893 ],
894 ]
895 );
896
897 $this->add_responsive_control(
898 't_content_basic_position_x',
899 [
900 'label' => __( 'Position X', 'wpdirectorykit' ),
901 'type' => Controls_Manager::CHOOSE,
902 'options' => [
903 'left' => [
904 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
905 'icon' => 'eicon-text-align-left',
906 ],
907 'center' => [
908 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
909 'icon' => 'eicon-text-align-center',
910 ],
911 'right' => [
912 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
913 'icon' => 'eicon-text-align-right',
914 ],
915 'justify' => [
916 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
917 'icon' => 'eicon-text-align-justify',
918 ],
919 ],
920 'default' => 'left',
921 'render_type' => 'template',
922 'selectors_dictionary' => [
923 'left' => 'align-items: flex-start;',
924 'center' => 'align-items: center;',
925 'right' => 'align-items: flex-end;',
926 'justify' => 'align-items: stretch;',
927 ],
928 'selectors' => [
929 '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item' => '{{VALUE}};',
930 ],
931 ]
932 );
933
934 $this->add_responsive_control(
935 't_content_basic_link_text',
936 [
937 'label' => __( 'Text of Link', 'wpdirectorykit' ),
938 'type' => \Elementor\Controls_Manager::TEXT,
939 'default' => __( 'View', 'wpdirectorykit' ),
940 ]
941 );
942
943 $selectors = array(
944 'normal' => '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-locations-carousel_mask',
945 );
946 $this->generate_renders_tabs($selectors, 't_content_basic_s', ['background']);
947
948 $this->end_controls_section();
949
950 $this->start_controls_section(
951 'tab_content_title',
952 [
953 'label' => esc_html__('Title', 'wpdirectorykit'),
954 'tab' => 'tab_content',
955 ]
956 );
957 $this->add_responsive_control(
958 'tab_content_title_hide',
959 [
960 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
961 'type' => Controls_Manager::SWITCHER,
962 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
963 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
964 'return_value' => 'none',
965 'default' => '',
966 'selectors' => [
967 '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_title' => 'display: {{VALUE}};',
968 ],
969 ]
970 );
971 $selectors = array(
972 'normal' => '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_title',
973 'hover'=>'{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_title%1$s'
974 );
975 $this->generate_renders_tabs($selectors, 'tab_content_title_s', 'full');
976 $this->end_controls_section();
977
978 $this->start_controls_section(
979 'tab_content_content',
980 [
981 'label' => esc_html__('Content', 'wpdirectorykit'),
982 'tab' => 'tab_content',
983 ]
984 );
985 $this->add_responsive_control(
986 'tab_content_content_hide',
987 [
988 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
989 'type' => Controls_Manager::SWITCHER,
990 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
991 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
992 'return_value' => 'none',
993 'default' => '',
994 'selectors' => [
995 '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_content' => 'display: {{VALUE}};',
996 ],
997 ]
998 );
999 $selectors = array(
1000 'normal' => '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_content',
1001 'hover'=>'{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_content%1$s'
1002 );
1003 $this->generate_renders_tabs($selectors, 'tab_content_content_s', 'full');
1004 $this->end_controls_section();
1005
1006 $this->start_controls_section(
1007 'tab_content_link',
1008 [
1009 'label' => esc_html__('Link', 'wpdirectorykit'),
1010 'tab' => 'tab_content',
1011 ]
1012 );
1013 $this->add_responsive_control(
1014 'tab_content_link_hide',
1015 [
1016 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1017 'type' => Controls_Manager::SWITCHER,
1018 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1019 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1020 'return_value' => 'none',
1021 'default' => '',
1022 'selectors' => [
1023 '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_link' => 'display: {{VALUE}};',
1024 ],
1025 ]
1026 );
1027 $selectors = array(
1028 'normal' => '{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_link',
1029 'hover'=>'{{WRAPPER}} .wdk-locations-carousel .wdk-locations-carousel_ini .wdk-slider-item_box_line .wdk-slider-item_box_link%1$s'
1030 );
1031 $this->generate_renders_tabs($selectors, 'tab_content_link_s', 'full');
1032 $this->end_controls_section();
1033
1034 }
1035 }
1036
1037 public function enqueue_styles_scripts() {
1038 wp_enqueue_style('slick');
1039 wp_enqueue_style('slick-theme');
1040 wp_enqueue_script('slick');
1041 wp_enqueue_style('wdk-locations-carousel');
1042 }
1043
1044 }
1045