PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
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-locations-carousel.php

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

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