PluginProbe
WP Directory Kit / 1.2.5
WP Directory Kit v1.2.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-similar-listings.php

wdk-listing-similar-listings.php in WP Directory Kit 1.2.5, at elementor-elements/classes/wdk-listing-similar-listings.php

1,531 lines 62.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 WdkListingSimilarListings 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-listing-similar-listings';
62 }
63
64 /**
65 * Retrieve the list of categories the widget belongs to.
66 *
67 * Used to determine where to display the widget in the editor.
68 *
69 * Note that currently Elementor supports only one category.
70 * When multiple categories passed, Elementor uses the first one.
71 *
72 * @since 1.1.0
73 *
74 * @access public
75 *
76 * @return array Widget categories.
77 */
78 public function get_categories() {
79 return [ 'wdk-elementor-listing-preview' ];
80 }
81
82 /**
83 * Retrieve the widget title.
84 *
85 * @since 1.1.0
86 *
87 * @access public
88 *
89 * @return string Widget title.
90 */
91 public function get_title() {
92 return esc_html__('Wdk Listing Similar Listings', 'wpdirectorykit');
93 }
94
95 /**
96 * Retrieve the widget icon.
97 *
98 * @since 1.1.0
99 *
100 * @access public
101 *
102 * @return string Widget icon.
103 */
104 public function get_icon() {
105 return 'eicon-products';
106 }
107
108 /**
109 * Register the widget controls.
110 *
111 * Adds different input fields to allow the user to change and customize the widget settings.
112 *
113 * @since 1.1.0
114 *
115 * @access protected
116 */
117 protected function register_controls() {
118 $this->generate_controls_conf();
119 $this->generate_controls_layout();
120 $this->generate_controls_styles();
121 $this->generate_controls_content();
122
123 $this->insert_pro_message('tab_conf');
124 parent::register_controls();
125 }
126
127 /**
128 * Render the widget output on the frontend.
129 *
130 * Written in PHP and used to generate the final HTML.
131 *
132 * @since 1.1.0
133 *
134 * @access protected
135 */
136 protected function render() {
137 parent::render();
138 global $wdk_listing_id;
139
140 $this->data['id_element'] = $this->get_id();
141 $this->data['settings'] = $this->get_settings();
142
143 $this->data['listings_count'] = 0;
144 $this->data['results'] = array();
145 $this->data['pagination_output'] = '';
146
147 $columns = array('ID', 'location_id', 'category_id', 'post_title', 'post_date', 'search', 'order_by','is_featured', 'address');
148 $external_columns = array('location_id', 'category_id', 'post_title');
149 $custom_parameters = array();
150
151 $this->data['custom_order'] = array();
152 if ($this->data['settings']['custom_order_list']) {
153 foreach ($this->data['settings']['custom_order_list'] as $item) {
154 if (empty($item['title']) || empty($item['key'])) {
155 continue;
156 }
157 $this->data['custom_order'][] = array('title'=>$item['title'],'key'=>$item['key']);
158 }
159 }
160
161 $controller = 'listing';
162 $offset = NULL;
163
164 if (isset($wdk_listing_id)) {
165 foreach($this->data['settings']['similar_by_fields'] as $similar_field) {
166
167 if(empty($similar_field['field'])) continue;
168
169 if ($similar_field['field_skip_if_empty'] == 'true' && empty(wdk_field_value(str_replace('field','',$similar_field['field']), $wdk_listing_id))) {
170 continue;
171 }
172
173 if($similar_field['field'] == 'is_featured') {
174 if (!empty(wdk_field_value(str_replace('field','',$similar_field['field']), $wdk_listing_id))) {
175 $custom_parameters[$similar_field['field']] = 'on';
176 } else {
177 $custom_parameters[$similar_field['field']] = 'off';
178 }
179 } else {
180 $custom_parameters[$similar_field['field']] = wdk_field_value(str_replace('field','',$similar_field['field']), $wdk_listing_id);
181 }
182 }
183 }
184
185 if(wmvc_show_data('featured_query', $this->data['settings']) == 'only_featured') {
186 $custom_parameters['is_featured'] = 'on';
187 }
188
189 if(wmvc_show_data('featured_query', $this->data['settings']) == 'only_unfeatured') {
190 $custom_parameters['is_featured'] = 'off';
191 }
192
193 $_GET['order_by'] = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
194
195 /* if detected custom field for order */
196 if(!empty($this->data['settings']['conf_order_by_custom'])) {
197 $_GET['order_by'] = $this->data['settings']['conf_order_by_custom'].' '.$this->data['settings']['conf_order'];
198 }
199
200 //wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters, TRUE);
201
202 /* filter same listing */
203
204 if (isset($wdk_listing_id)) {
205 global $wpdb;
206 $this->WMVC->db->where($wpdb->prefix.'wdk_listings.post_id != '.$wdk_listing_id) ;
207 }
208
209 $this->data['results'] = $this->WMVC->listing_m->get_pagination($this->data['settings']['per_page'], $offset, array('is_activated' => 1,'is_approved'=>1));
210
211 if(!empty($this->data['results']) && $this->data['listings_count'] == 0)
212 $this->data['listings_count'] = wmvc_count($this->data['results']);
213
214 $this->data['settings']['content_button_icon'] = $this->generate_icon($this->data['settings']['content_button_icon']);
215
216 $this->data['is_edit_mode'] = false;
217 if(Plugin::$instance->editor->is_edit_mode())
218 $this->data['is_edit_mode'] = true;
219
220 if(isset($_GET['wmvc_view_type']) && $this->data['settings']['get_filters_enable'] == 'yes') {
221 if(wmvc_xss_clean($_GET['wmvc_view_type']) == 'grid')
222 $this->data['settings']['layout_type'] = 'grid';
223 if(wmvc_xss_clean($_GET['wmvc_view_type']) == 'list')
224 $this->data['settings']['layout_type'] = 'list';
225 }
226
227 echo $this->view('wdk-listing-similar-listings', $this->data);
228 }
229
230
231 private function generate_controls_conf() {
232 $this->start_controls_section(
233 'tab_conf_main_section',
234 [
235 'label' => esc_html__('Main', 'wpdirectorykit'),
236 'tab' => 'tab_conf',
237 ]
238 );
239
240 if(true){
241 $this->add_control(
242 'per_page',
243 [
244 'label' => __( 'Limit Results (Per page)', 'wpdirectorykit' ),
245 'type' => \Elementor\Controls_Manager::NUMBER,
246 'min' => 1,
247 'max' => 250,
248 'step' => 1,
249 'default' => 6,
250 ]
251 );
252
253 $this->add_control(
254 'conf_order_by',
255 [
256 'label' => __('Default Order By Column', 'wpdirectorykit'),
257 'type' => Controls_Manager::SELECT,
258 'label_block' => true,
259 'options' => [
260 'none' => __('None', 'wpdirectorykit'),
261 'post_id' => __('ID', 'wpdirectorykit'),
262 'post_title' => __('Title', 'wpdirectorykit'),
263 ],
264 'default' => 'post_id',
265 ]
266 );
267
268 $this->add_control(
269 'conf_order_by_custom',
270 [
271 'label' => __('Default Custom Order By (小olumn', 'wpdirectorykit'),
272 'description' => '<span style="word-break: break-all;">'.__( 'Example: ', 'wpdirectorykit' ).
273 '<br> field_13_NUMBER - where 13 is field id, NUMBER - field type'.
274 '<br> field_4_NUMBER - where 4 is field id, NUMBER - field type'.
275 '<br> field_6_DROPDOWN - where 6 is field id, DROPDOWN - field type'.
276 '<br> category_title - Category Title'.
277 '<br> location_title - Location Title'.
278 '</span>',
279 'type' => Controls_Manager::TEXT,
280 'label_block' => true,
281 'default' => 'post_id',
282 ]
283 );
284
285 $this->add_control(
286 'conf_order',
287 [
288 'label' => __('Default Listing Order', 'wpdirectorykit'),
289 'type' => Controls_Manager::SELECT,
290 'label_block' => true,
291 'options' => [
292 'asc' => __('Ascending', 'wpdirectorykit'),
293 'desc' => __('Descending', 'wpdirectorykit')
294 ],
295 'default' => 'desc',
296 ]
297 );
298
299 }
300
301 $this->add_control(
302 'featured_query',
303 [
304 'label' => __( 'Featured Listings', 'wpdirectorykit' ),
305 'type' => \Elementor\Controls_Manager::SELECT,
306 'default' => 'any',
307 'options' => [
308 'any' => __( 'Show Featured and Not Featured', 'wpdirectorykit' ),
309 'only_featured' => __( 'Show Only Featured', 'wpdirectorykit' ),
310 'only_unfeatured' => __( 'Show Only Not Featured', 'wpdirectorykit' ),
311 ],
312 ]
313 );
314
315 $WMVC = &wdk_get_instance();
316 $WMVC->model('field_m');
317 $fields_data = $WMVC->field_m->get_fields_data();
318 $fields_list = array('0' => esc_html__('Not Selected', 'wpdirectorykit'));
319 $fields_list ['category_id'] = esc_html__('Category', 'wpdirectorykit');
320 $fields_list ['location_id'] = esc_html__('Location', 'wpdirectorykit');
321 $fields_list ['is_featured'] = esc_html__('Featured', 'wpdirectorykit');
322
323 foreach($fields_data as $field)
324 {
325 $fields_list['field_'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
326 }
327
328 $repeater_similar_by_fields = new Repeater();
329 $repeater_similar_by_fields->start_controls_tabs( 'repeater_similar_by_fields' );
330
331 $repeater_similar_by_fields->add_control(
332 'field',
333 [
334 'label' => __( 'Field', 'wpdirectorykit' ),
335 'type' => \Elementor\Controls_Manager::SELECT,
336 'options' => $fields_list,
337 ]
338 );
339
340 $repeater_similar_by_fields->add_control (
341 'field_skip_if_empty',
342 [
343 'label' => __( 'Skip from query if empty value', 'wpdirectorykit' ),
344 'type' => \Elementor\Controls_Manager::SWITCHER,
345 'label_on' => __( 'On', 'wpdirectorykit' ),
346 'label_off' => __( 'Off', 'wpdirectorykit' ),
347 'return_value' => 'true',
348 'default' => '',
349 ]
350 );
351
352 $repeater_similar_by_fields->end_controls_tabs();
353
354 $this->add_control(
355 'similar_by_fields',
356 [
357 'label' => esc_html__('Fields For Query Similar Listings', 'wpdirectorykit'),
358 'type' => Controls_Manager::REPEATER,
359 'fields' => $repeater_similar_by_fields->get_controls(),
360 'default' => [
361 [
362 'field' => 'category_id',
363 ],
364 ],
365 'title_field' => '{{{ field }}}',
366 ]
367 );
368
369 $this->add_control(
370 'important_note',
371 [
372 'label' => '',
373 'type' => \Elementor\Controls_Manager::RAW_HTML,
374 'raw' => wdk_sprintf(__( 'Edit Result Card Designer <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_resultitem')),
375 'content_classes' => 'wdk_elementor_hint',
376 ]
377 );
378
379 $this->end_controls_section();
380
381 $this->start_controls_section(
382 'tab_conf_main_section_order',
383 [
384 'label' => esc_html__('Custom Order', 'wpdirectorykit'),
385 'tab' => 'tab_conf',
386 ]
387 );
388
389 $repeater_order = new Repeater();
390 $repeater_order->start_controls_tabs( 'orders' );
391 $repeater_order->add_control(
392 'key',
393 [
394 'label' => __( 'Order Key', 'wpdirectorykit' ),
395 'type' => \Elementor\Controls_Manager::TEXT,
396 'placeholder' => 'post_id ASC',
397 'description' => '<span style="word-break: break-all;">'.__( 'Custom Fields Order Example: ', 'wpdirectorykit' ).
398 '<br> field_13_NUMBER ASC - where 13 is field id, NUMBER - field type'.
399 '<br> field_4_NUMBER DESC - where 4 is field id, NUMBER - field type'.
400 '<br> field_6_DROPDOWN ASC - where 6 is field id, DROPDOWN - field type'.
401 '<br> category_title - Category Title'.
402 '<br> location_title - Location Title'.
403 '</span>',
404 ]
405 );
406 $repeater_order->add_control(
407 'title',
408 [
409 'label' => __( 'Title', 'wpdirectorykit' ),
410 'type' => \Elementor\Controls_Manager::TEXT,
411 'placeholder' => __( 'Title', 'wpdirectorykit' ),
412 ]
413 );
414 $repeater_order->end_controls_tabs();
415
416 $this->add_control(
417 'custom_order_list',
418 [
419 'type' => Controls_Manager::REPEATER,
420 'fields' => $repeater_order->get_controls(),
421 'default' => [
422 ],
423 'title_field' => '{{{ title }}}',
424 ]
425 );
426
427 $this->end_controls_section();
428
429 }
430
431 private function generate_controls_layout() {
432 $this->start_controls_section(
433 'tab_content',
434 [
435 'label' => esc_html__('Basic', 'wpdirectorykit'),
436 'tab' => 'tab_layout',
437 ]
438 );
439
440 $this->add_control(
441 'layout_type',
442 [
443 'label' => __( 'Layout Type', 'wpdirectorykit' ),
444 'type' => \Elementor\Controls_Manager::SELECT,
445 'default' => 'grid',
446 'options' => [
447 'grid' => __( 'Grid', 'wpdirectorykit' ),
448 'list' => __( 'List', 'wpdirectorykit' ),
449 'carousel' => __( 'Carousel', 'wpdirectorykit' ),
450 ],
451 ]
452 );
453
454 $this->add_responsive_control(
455 'row_gap_col',
456 [
457 'label' => __( 'Columns', 'wpdirectorykit' ),
458 'type' => Controls_Manager::SELECT,
459 'options' => [
460 '' => esc_html__('Default', 'wpdirectorykit'),
461 'auto' => esc_html__('Auto', 'wpdirectorykit'),
462 '100%' => '1',
463 '50%' => '2',
464 'calc(100% / 3)' => '3',
465 '25%' => '4',
466 '20%' => '5',
467 'auto_flexible' => 'auto flexible',
468 ],
469 'selectors_dictionary' => [
470 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
471 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
472 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
473 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
474 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
475 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
476 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
477 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
478 ],
479 'selectors' => [
480 '{{WRAPPER}} .wdk-row .wdk-col' => '{{UNIT}}',
481 ],
482 'default' => '',
483 'separator' => 'before',
484 'conditions' => [
485 'terms' => [
486 [
487 'name' => 'layout_type',
488 'operator' => '==',
489 'value' => 'grid',
490 ]
491 ],
492 ],
493 ]
494 );
495
496 $this->add_responsive_control(
497 'column_gap',
498 [
499 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
500 'type' => Controls_Manager::SLIDER,
501 'default' => [
502 'size' => 10,
503 ],
504 'range' => [
505 'px' => [
506 'min' => 0,
507 'max' => 60,
508 ],
509 ],
510 'selectors' => [
511 '{{WRAPPER}} .wdk-row .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
512 '{{WRAPPER}} .wdk-row' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
513 ],
514 'conditions' => [
515 'terms' => [
516 [
517 'name' => 'layout_type',
518 'operator' => '==',
519 'value' => 'grid',
520 ]
521 ],
522 ],
523 ]
524 );
525
526 $this->add_responsive_control(
527 'row_gap',
528 [
529 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
530 'type' => Controls_Manager::SLIDER,
531 'default' => [
532 'size' => 10,
533 ],
534 'range' => [
535 'px' => [
536 'min' => 0,
537 'max' => 60,
538 ],
539 ],
540 'selectors' => [
541 '{{WRAPPER}} .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
542 '{{WRAPPER}} .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
543 ],
544 'conditions' => [
545 'terms' => [
546 [
547 'name' => 'layout_type',
548 'operator' => '!=',
549 'value' => 'carousel',
550 ]
551 ],
552 ],
553 ]
554 );
555
556 $this->add_responsive_control(
557 'thumbnail_width',
558 [
559 'label' => esc_html__('Thumbnail width (For List Version)', 'wpdirectorykit'),
560 'type' => Controls_Manager::SLIDER,
561 'default' => [
562 'size' => 35,
563 'unit' => '%',
564 ],
565 'size_units' => [ 'px', '%' ],
566 'range' => [
567 'px' => [
568 'min' => 0,
569 'max' => 600,
570 ],
571 '%' => [
572 'min' => 0,
573 'max' => 100,
574 ],
575 ],
576 'selectors' => [
577 '{{WRAPPER}} .wdk-element .wdk-listing-card.list .wdk-thumbnail' => 'flex: 0 0 {{SIZE}}{{UNIT}};',
578 ],
579 'conditions' => [
580 'terms' => [
581 [
582 'name' => 'layout_type',
583 'operator' => '==',
584 'value' => 'list',
585 ]
586 ],
587 ],
588 ]
589 );
590
591 /* Carousel Grid Config */
592 if(true) {
593 $this->add_responsive_control(
594 'carousel_column_gap_carousel',
595 [
596 'label' => esc_html__('Slider Gap', 'wpdirectorykit'),
597 'type' => Controls_Manager::SLIDER,
598 'range' => [
599 'px' => [
600 'min' => 0,
601 'max' => 60,
602 ],
603 ],
604 'selectors' => [
605 '{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini ' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};',
606 ],
607 'conditions' => [
608 'terms' => [
609 [
610 'name' => 'layout_type',
611 'operator' => '==',
612 'value' => 'carousel',
613 ]
614 ],
615 ],
616 ]
617 );
618
619 $this->add_responsive_control (
620 'carousel_column_gap',
621 [
622 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
623 'type' => Controls_Manager::SLIDER,
624 'default' => [
625 'size' => 10,
626 ],
627 'range' => [
628 'px' => [
629 'min' => 0,
630 'max' => 60,
631 ],
632 ],
633 'selectors' => [
634 '{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};',
635 '{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
636 ],
637 'conditions' => [
638 'terms' => [
639 [
640 'name' => 'layout_type',
641 'operator' => '==',
642 'value' => 'carousel',
643 ]
644 ],
645 ],
646 ]
647 );
648
649 $this->add_responsive_control(
650 'carousel_column_gap_top',
651 [
652 'label' => esc_html__('Columns Gap Top', 'wpdirectorykit'),
653 'type' => Controls_Manager::SLIDER,
654 'default' => [
655 'size' => 0,
656 ],
657 'range' => [
658 'px' => [
659 'min' => 0,
660 'max' => 60,
661 ],
662 ],
663 'selectors' => [
664 '{{WRAPPER}} .wdk_results_listings_slider_box' => 'padding-top: {{SIZE}}{{UNIT}};',
665 ],
666 'conditions' => [
667 'terms' => [
668 [
669 'name' => 'layout_type',
670 'operator' => '==',
671 'value' => 'carousel',
672 ]
673 ],
674 ],
675 ]
676 );
677
678 $this->add_responsive_control(
679 'carousel_column_gap_bottom',
680 [
681 'label' => esc_html__('Columns Gap Bottom', 'wpdirectorykit'),
682 'type' => Controls_Manager::SLIDER,
683 'default' => [
684 'size' => 10,
685 ],
686 'range' => [
687 'px' => [
688 'min' => 0,
689 'max' => 60,
690 ],
691 ],
692 'selectors' => [
693 '{{WRAPPER}} .wdk_results_listings_slider_box' => 'padding-bottom: {{SIZE}}{{UNIT}};',
694 ],
695 'conditions' => [
696 'terms' => [
697 [
698 'name' => 'layout_type',
699 'operator' => '==',
700 'value' => 'carousel',
701 ]
702 ],
703 ],
704 ]
705 );
706 }
707
708 $this->end_controls_section();
709
710 $this->start_controls_section(
711 'layout_carousel_sec',
712 [
713 'label' => esc_html__('Carousel Options', 'wpdirectorykit'),
714 'tab' => 'tab_layout',
715 'conditions' => [
716 'terms' => [
717 [
718 'name' => 'layout_type',
719 'operator' => '==',
720 'value' => 'carousel',
721 ]
722 ],
723 ],
724 ]
725 );
726
727 $this->add_control(
728 'layout_carousel_is_infinite',
729 [
730 'label' => __( 'Infinite', 'wpdirectorykit' ),
731 'type' => \Elementor\Controls_Manager::SWITCHER,
732 'label_on' => __( 'On', 'wpdirectorykit' ),
733 'label_off' => __( 'Off', 'wpdirectorykit' ),
734 'return_value' => 'true',
735 'default' => 'true',
736 ]
737 );
738
739 $this->add_control(
740 'layout_carousel_is_autoplay',
741 [
742 'label' => __( 'Autoplay', 'wpdirectorykit' ),
743 'type' => \Elementor\Controls_Manager::SWITCHER,
744 'label_on' => __( 'On', 'wpdirectorykit' ),
745 'label_off' => __( 'Off', 'wpdirectorykit' ),
746 'return_value' => 'true',
747 'default' => '',
748 ]
749 );
750
751 $this->add_control(
752 'layout_carousel_speed',
753 [
754 'label' => __( 'Speed', 'wpdirectorykit' ),
755 'type' => \Elementor\Controls_Manager::NUMBER,
756 'min' => 0,
757 'max' => 100000,
758 'step' => 100,
759 'default' => 500,
760 ]
761 );
762
763 $this->add_control(
764 'layout_carousel_animation_style',
765 [
766 'label' => __( 'Animation Style', 'wpdirectorykit' ),
767 'type' => \Elementor\Controls_Manager::SELECT,
768 'default' => 'fade',
769 'options' => [
770 'slide' => __( 'Slide', 'wpdirectorykit' ),
771 'fade' => __( 'Fade', 'wpdirectorykit' ),
772 'fade_in_in' => __( 'Fade in', 'wpdirectorykit' ),
773 ],
774 ]
775 );
776
777 $this->add_control(
778 'layout_carousel_cssease',
779 [
780 'label' => __( 'cssEase ', 'wpdirectorykit' ),
781 'type' => \Elementor\Controls_Manager::SELECT,
782 'default' => 'linear',
783 'options' => [
784 'linear' => __( 'linear', 'wpdirectorykit' ),
785 'ease' => __( 'ease', 'wpdirectorykit' ),
786 'ease-in' => __( 'ease-in', 'wpdirectorykit' ),
787 'ease-out' => __( 'ease-out', 'wpdirectorykit' ),
788 'ease-in-out' => __( 'ease-in-out', 'wpdirectorykit' ),
789 'step-start' => __( 'step-start', 'wpdirectorykit' ),
790 'step-end' => __( 'step-end', 'wpdirectorykit' ),
791 ],
792 ]
793 );
794
795 $this->add_responsive_control(
796 'layout_carousel_columns',
797 [
798 'label' => __( 'Count grid', 'wpdirectorykit' ),
799 'type' => \Elementor\Controls_Manager::NUMBER,
800 'min' => 1,
801 'max' => 10,
802 'step' => 1,
803 'default' => 3,
804 ]
805 );
806
807 $this->end_controls_section();
808
809 }
810
811 private function generate_controls_styles() {
812 $this->start_controls_section(
813 'sstyles_thmbn_section',
814 [
815 'label' => esc_html__('Section Image', 'wpdirectorykit'),
816 'tab' => Controls_Manager::TAB_STYLE,
817 ]
818 );
819
820 $this->add_responsive_control(
821 'styles_thmbn_des_type',
822 [
823 'label' => __( 'Design type ', 'wpdirectorykit' ),
824 'type' => \Elementor\Controls_Manager::SELECT,
825 'default' => 'wdk_size_image_cover',
826 'options' => [
827 'wdk_size_image_ori' => __( 'Default Sizes', 'wpdirectorykit' ),
828 'wdk_size_image_cover' => __( 'Image auto crop/resize', 'wpdirectorykit' ),
829 ],
830 ]
831 );
832
833 $this->add_responsive_control(
834 'styles_thmbn_des_height',
835 [
836 'label' => esc_html__('Height', 'wpdirectorykit'),
837 'type' => Controls_Manager::SLIDER,
838 'range' => [
839 'px' => [
840 'min' => 50,
841 'max' => 1500,
842 ],
843 'vw' => [
844 'min' => 0,
845 'max' => 100,
846 ]
847 ],
848 'size_units' => [ 'px', 'vw' ],
849 'default' => [
850 'size' => 220,
851 'unit' => 'px',
852 ],
853 'selectors' => [
854 '{{WRAPPER}} .wdk_size_image_cover .wdk-listing-card .wdk-thumbnail .wdk-image' => 'height: {{SIZE}}{{UNIT}}',
855 ],
856 'separator' => 'after',
857 'conditions' => [
858 'relation' => 'or',
859 'terms' => [
860 [
861 'name' => 'styles_thmbn_des_type',
862 'operator' => '==',
863 'value' => 'wdk_size_image_cover',
864 ],
865 [
866 'name' => 'styles_thmbn_des_type',
867 'operator' => '==',
868 'value' => 'wdk_image_cover',
869 ]
870 ],
871 ]
872 ]
873 );
874 $this->end_controls_section();
875
876 $this->start_controls_section(
877 'styles_carousel_arrows_section',
878 [
879 'label' => esc_html__('Carousel Arrows', 'wpdirectorykit'),
880 'tab' => Controls_Manager::TAB_STYLE,
881 'conditions' => [
882 'terms' => [
883 [
884 'name' => 'layout_type',
885 'operator' => '==',
886 'value' => 'carousel',
887 ]
888 ],
889 ],
890 ]
891 );
892
893 $this->add_responsive_control(
894 'styles_carousel_arrows_hide',
895 [
896 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
897 'type' => Controls_Manager::SWITCHER,
898 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
899 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
900 'return_value' => 'none',
901 'default' => '',
902 'selectors' => [
903 '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows' => 'display: {{VALUE}};',
904 ],
905 ]
906 );
907
908 $this->add_responsive_control(
909 'styles_carousel_arrows_position',
910 [
911 'label' => __( 'Position', 'wpdirectorykit' ),
912 'type' => \Elementor\Controls_Manager::SELECT,
913 'default' => 'wdk_slider_arrows_bottom',
914 'options' => [
915 'wdk_slider_arrows_bottom' => __( 'Bottom', 'wpdirectorykit' ),
916 'wdk_slider_arrows_middle' => __( 'Center', 'wpdirectorykit' ),
917 'wdk_slider_arrows_top' => __( 'Top', 'wpdirectorykit' ),
918 ],
919 ]
920 );
921
922 if(false)
923 $this->add_responsive_control(
924 'styles_carousel_arrows_position_style',
925 [
926 'label' => __( 'Position Style', 'wpdirectorykit' ),
927 'type' => \Elementor\Controls_Manager::SELECT,
928 'default' => 'wdk_slider_arrows_out',
929 'options' => [
930 'wdk_slider_arrows_out' => __( 'Out', 'wpdirectorykit' ),
931 'wdk_slider_arrows_in' => __( 'In', 'wpdirectorykit' ),
932 ],
933 ]
934 );
935
936 $this->add_responsive_control(
937 'styles_carousel_arrows_align',
938 [
939 'label' => __( 'Align', 'wpdirectorykit' ),
940 'type' => Controls_Manager::CHOOSE,
941 'options' => [
942 'left' => [
943 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
944 'icon' => 'eicon-text-align-left',
945 ],
946 'center' => [
947 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
948 'icon' => 'eicon-text-align-center',
949 ],
950 'right' => [
951 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
952 'icon' => 'eicon-text-align-right',
953 ],
954 'justify' => [
955 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
956 'icon' => 'eicon-text-align-justify',
957 ],
958 ],
959 'render_type' => 'ui',
960 'selectors_dictionary' => [
961 'left' => 'justify-content: flex-start;',
962 'center' => 'justify-content: center;',
963 'right' => 'justify-content: flex-end;',
964 'justify' => 'justify-content: space-between;',
965 ],
966 'selectors' => [
967 '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows' => '{{VALUE}};',
968 ],
969 'conditions' => [
970 'terms' => [
971 [
972 'name' => 'styles_carousel_arrows_position',
973 'operator' => '!=',
974 'value' => 'wdk_slider_arrows_middle',
975 ]
976 ],
977 ],
978 ]
979 );
980
981 $this->add_responsive_control(
982 'styles_carousel_arrows_icon_left_h',
983 [
984 'label' => esc_html__('Arrow left', 'wpdirectorykit'),
985 'type' => Controls_Manager::HEADING,
986 'separator' => 'before',
987 ]
988 );
989
990 $this->add_responsive_control(
991 'styles_carousel_arrows_s_m_left_margin',
992 [
993 'label' => esc_html__( 'Margin', 'wpdirectorykit' ),
994 'type' => Controls_Manager::DIMENSIONS,
995 'size_units' => [ 'px', 'em', '%' ],
996 'allowed_dimensions' => 'horizontal',
997 'selectors' => [
998 '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow.wdk-slider-prev' => 'margin-right:{{RIGHT}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};',
999 ],
1000 ]
1001 );
1002
1003 $this->add_responsive_control(
1004 'styles_carousel_arrows_icon_left',
1005 [
1006 'label' => esc_html__('Icon', 'wpdirectorykit'),
1007 'type' => Controls_Manager::ICONS,
1008 'label_block' => true,
1009 'default' => [
1010 'value' => 'fa fa-angle-left',
1011 'library' => 'solid',
1012 ],
1013 ]
1014 );
1015
1016 $this->add_responsive_control(
1017 'styles_carousel_arrows_icon_right_h',
1018 [
1019 'label' => esc_html__('Arrow right', 'wpdirectorykit'),
1020 'type' => Controls_Manager::HEADING,
1021 'separator' => 'before',
1022 ]
1023 );
1024
1025 $this->add_responsive_control(
1026 'styles_carousel_arrows_s_m_right_margin',
1027 [
1028 'label' => esc_html__( 'Margin', 'wpdirectorykit' ),
1029 'type' => Controls_Manager::DIMENSIONS,
1030 'size_units' => [ 'px', 'em', '%' ],
1031 'allowed_dimensions' => 'horizontal',
1032 'selectors' => [
1033 '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow.wdk-slider-next' => 'margin-right:{{RIGHT}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};',
1034 ],
1035 ]
1036 );
1037
1038 $this->add_responsive_control(
1039 'styles_carousel_arrows_icon_right',
1040 [
1041 'label' => esc_html__('Icon', 'wpdirectorykit'),
1042 'type' => Controls_Manager::ICONS,
1043 'label_block' => true,
1044 'default' => [
1045 'value' => 'fa fa-angle-right',
1046 'library' => 'solid',
1047 ],
1048 ]
1049 );
1050
1051 $selectors = array(
1052 'normal' => '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow',
1053 'hover'=>'{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow%1$s'
1054 );
1055 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_dynamic', ['typo','color','background','border','border_radius','padding','shadow','transition']);
1056
1057 $this->end_controls_section();
1058
1059 $this->start_controls_section(
1060 'styles_carousel_dots_section',
1061 [
1062 'label' => esc_html__('Section Dots', 'wpdirectorykit'),
1063 'tab' => Controls_Manager::TAB_STYLE,
1064 'conditions' => [
1065 'terms' => [
1066 [
1067 'name' => 'layout_type',
1068 'operator' => '==',
1069 'value' => 'carousel',
1070 ]
1071 ],
1072 ],
1073 ]
1074 );
1075
1076 $this->add_responsive_control(
1077 'styles_carousel_dots_hide',
1078 [
1079 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1080 'type' => Controls_Manager::SWITCHER,
1081 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1082 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1083 'return_value' => 'none',
1084 'default' => '',
1085 'selectors' => [
1086 '{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots' => 'display: {{VALUE}} !important;',
1087 ],
1088 ]
1089 );
1090
1091 $this->add_responsive_control(
1092 'styles_carousel_dots_position_style',
1093 [
1094 'label' => __( 'Position Style', 'wpdirectorykit' ),
1095 'type' => \Elementor\Controls_Manager::SELECT,
1096 'default' => 'wdk_slider_dots_out',
1097 'options' => [
1098 'wdk_slider_dots_out' => __( 'Out', 'wpdirectorykit' ),
1099 'wdk_slider_dots_in' => __( 'In', 'wpdirectorykit' ),
1100 ],
1101 ]
1102 );
1103
1104 $this->add_responsive_control(
1105 'styles_carousel_dots_align',
1106 [
1107 'label' => __( 'Position', 'wpdirectorykit' ),
1108 'type' => Controls_Manager::CHOOSE,
1109 'options' => [
1110 'left' => [
1111 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1112 'icon' => 'eicon-text-align-left',
1113 ],
1114 'center' => [
1115 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1116 'icon' => 'eicon-text-align-center',
1117 ],
1118 'right' => [
1119 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1120 'icon' => 'eicon-text-align-right',
1121 ],
1122 'justify' => [
1123 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
1124 'icon' => 'eicon-text-align-justify',
1125 ],
1126 ],
1127 'render_type' => 'ui',
1128 'selectors_dictionary' => [
1129 'left' => 'justify-content: flex-start;',
1130 'center' => 'justify-content: center;',
1131 'right' => 'justify-content: flex-end;',
1132 'justify' => 'justify-content: space-between;',
1133 ],
1134 'selectors' => [
1135 '{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots' => '{{VALUE}};',
1136 ],
1137 ]
1138 );
1139
1140 $this->add_responsive_control(
1141 'styles_carousel_dots_icon',
1142 [
1143 'label' => esc_html__('Icon', 'wpdirectorykit'),
1144 'type' => Controls_Manager::ICONS,
1145 'label_block' => true,
1146 'default' => [
1147 'value' => 'fas fa-circle',
1148 'library' => 'solid',
1149 ],
1150 ]
1151 );
1152
1153 $selectors = array(
1154 'normal' => '{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots li .wdk_lr_dot',
1155 'hover'=>'{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots li .wdk_lr_dot%1$s'
1156 );
1157 $this->generate_renders_tabs($selectors, 'styles_carousel_dots_dynamic', ['margin','color','background','border','border_radius','padding','shadow','transition','font-size','hover_animation']);
1158
1159 $this->end_controls_section();
1160 }
1161
1162 private function generate_controls_content() {
1163 $this->start_controls_section(
1164 'content_thumbnail_section',
1165 [
1166 'label' => esc_html__('Colors', 'wpdirectorykit'),
1167 'tab' => '1',
1168 ]
1169 );
1170
1171 $this->add_control(
1172 'content_thumbnail_section_header',
1173 [
1174 'label' => esc_html__('Color Hover Thumbnail', 'wpdirectorykit'),
1175 'type' => Controls_Manager::HEADING,
1176 ]
1177 );
1178
1179 $this->add_responsive_control(
1180 'content_thumbnail_section_d_background',
1181 [
1182 'label' => esc_html__( 'Color', 'wpdirectorykit' ),
1183 'description' => esc_html__( 'Set some opacity for color', 'wpdirectorykit' ),
1184 'type' => Controls_Manager::COLOR,
1185 'selectors' => [
1186 '{{WRAPPER}} .wdk-listing-card .wdk-thumbnail::before, {{WRAPPER}} .wdk-listing-card .wdk-thumbnail::after,{{WRAPPER}} .wdk-listing-card .overlay' => 'background-color: {{VALUE}};',
1187 ],
1188 ]
1189 );
1190
1191 $this->add_control(
1192 'content_thumbnail_section_header_f',
1193 [
1194 'label' => esc_html__('Shadow around Card, for Featured Listings', 'wpdirectorykit'),
1195 'type' => Controls_Manager::HEADING,
1196 ]
1197 );
1198
1199 $this->add_group_control(
1200 Group_Control_Box_Shadow::get_type(),
1201 [
1202 'name' => 'content_thumbnail_section_d_featured',
1203 'exclude' => [
1204 'field_shadow_position',
1205 ],
1206 'selector' => '{{WRAPPER}} .wdk-listing-card.is_featured',
1207 ]
1208 );
1209
1210 $this->end_controls_section();
1211 $items = [
1212 [
1213 'key'=>'content_card',
1214 'label'=> esc_html__('Card', 'wpdirectorykit'),
1215 'selector'=>'.wdk-element .wdk-listing-card',
1216 'options'=>'full',
1217 ],
1218 [
1219 'key'=>'content_label',
1220 'label'=> esc_html__('Over Image Top', 'wpdirectorykit'),
1221 'selector'=>'.wdk-element .wdk-listing-card .wdk-thumbnail .wdk-over-image-top span',
1222 'options'=>'full',
1223 ],
1224 [
1225 'key'=>'content_type',
1226 'label'=> esc_html__('Over Image Bottom', 'wpdirectorykit'),
1227 'selector'=>'.wdk-element .wdk-listing-card .wdk-thumbnail .wdk-over-image-bottom',
1228 'is_featured'=>'.wdk-element .wdk-listing-card.is_featured .wdk-thumbnail .wdk-over-image-bottom',
1229 'options'=>'full',
1230 ],
1231 [
1232 'key'=>'content_title',
1233 'label'=> esc_html__('Title Part', 'wpdirectorykit'),
1234 'selector'=>'.wdk-element .wdk-listing-card .wdk-title .title',
1235 'options'=>'full',
1236 ],
1237 [
1238 'key'=>'content_description',
1239 'label'=> esc_html__('Subtitle part', 'wpdirectorykit'),
1240 'selector'=>'.wdk-element .wdk-listing-card .wdk-subtitle-part',
1241 'options'=>'full',
1242 ],
1243 [
1244 'key'=>'content_items',
1245 'label'=> esc_html__('Features part', 'wpdirectorykit'),
1246 'selector'=>'.wdk-element .wdk-listing-card .wdk-features-part span',
1247 'options'=>'full',
1248 ],
1249 [
1250 'key'=>'wdk-divider',
1251 'label'=> esc_html__('Divider', 'wpdirectorykit'),
1252 'selector'=>'.wdk-element .wdk-listing-card .wdk-divider',
1253 'options'=>'full',
1254 ],
1255 [
1256 'key'=>'content_price',
1257 'label'=> esc_html__('Pricing part', 'wpdirectorykit'),
1258 'selector'=>'.wdk-element .wdk-listing-card .wdk-footer .wdk-price',
1259 'options'=>'full',
1260 ],
1261 [
1262 'key'=>'content_button',
1263 'label'=> esc_html__('Button Open', 'wpdirectorykit'),
1264 'selector'=>'.wdk-element .wdk-listing-card .wdk-footer .wdk-btn',
1265 'options'=>'full',
1266 ],
1267 ];
1268
1269 foreach ($items as $item) {
1270 $this->start_controls_section(
1271 $item['key'].'_section',
1272 [
1273 'label' => $item['label'],
1274 'tab' => '1',
1275 ]
1276 );
1277 $this->add_responsive_control(
1278 $item['key'].'_hide',
1279 [
1280 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1281 'type' => Controls_Manager::SWITCHER,
1282 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1283 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1284 'return_value' => 'none',
1285 'default' => '',
1286 'selectors' => [
1287 '{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};',
1288 ],
1289 ]
1290 );
1291 $selectors = array(
1292 'normal' => '{{WRAPPER}} '.$item['selector'],
1293 'hover'=>'{{WRAPPER}} '.$item['selector'].'%1$s'
1294 );
1295
1296 if(isset($item['is_featured'])) {
1297 $selectors['featured'] = '{{WRAPPER}} '.$item['is_featured'];
1298 }
1299
1300 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
1301
1302 /* special for some elements */
1303 if ($item['key'] == 'content_description') {
1304
1305 $this->add_control(
1306 'content_description_limit',
1307 [
1308 'label' => __( 'Limit Line (per field)', 'wpdirectorykit' ),
1309 'type' => \Elementor\Controls_Manager::NUMBER,
1310 'min' => 1,
1311 'max' => 10,
1312 'step' => 1,
1313 'default' => 3,
1314 'selectors' => [
1315 '{{WRAPPER}} .wdk-listing-card .wdk-subtitle-part span' => '-webkit-line-clamp: {{VALUE}};',
1316 ],
1317 ]
1318 );
1319
1320 }
1321 if($item['key'] == 'content_button') {
1322 $this->add_control(
1323 $item['key'].'_icon',
1324 [
1325 'label' => esc_html__('Icon', 'wpdirectorykit'),
1326 'type' => Controls_Manager::ICONS,
1327 'label_block' => true,
1328 'default' => [
1329 'value' => 'fa fa-angle-right',
1330 'library' => 'solid',
1331 ],
1332 ]
1333 );
1334 $this->add_responsive_control(
1335 $item['key'].'_text',
1336 [
1337 'label' => __( 'Text of Link', 'wpdirectorykit' ),
1338 'type' => \Elementor\Controls_Manager::TEXT,
1339 'default' => '',
1340 ]
1341 );
1342
1343 $selectors = array(
1344 'normal' => '{{WRAPPER}} '.$item['selector'].' i',
1345 );
1346 $this->generate_renders_tabs($selectors, $item['key'].'_icon_dynamic', ['margin']);
1347 }
1348
1349 if($item['key'] == 'content_label') {
1350 $this->add_control(
1351 $item['key'].'_parent_head',
1352 [
1353 'label' => esc_html__('Parent Box', 'wpdirectorykit'),
1354 'type' => Controls_Manager::HEADING,
1355 'separator' => 'before',
1356 ]
1357 );
1358
1359 $selectors = array(
1360 'normal' => '{{WRAPPER}} .wdk-element .wdk-listing-card .wdk-over-image-top',
1361 );
1362 $this->generate_renders_tabs($selectors, $item['key'].'_parent_dynamic', ['margin']);
1363 }
1364
1365 if($item['key'] == 'content_items') {
1366 $this->add_control(
1367 $item['key'].'_parent_head',
1368 [
1369 'label' => esc_html__('Parent Box', 'wpdirectorykit'),
1370 'type' => Controls_Manager::HEADING,
1371 'separator' => 'before',
1372 ]
1373 );
1374
1375 $selectors = array(
1376 'normal' => '{{WRAPPER}} .wdk-element .wdk-listing-card .wdk-features-part',
1377 );
1378 $this->generate_renders_tabs($selectors, $item['key'].'_parent_dynamic', ['margin','align']);
1379 }
1380
1381 if($item['key'] == 'content_label') {
1382 $this->add_responsive_control(
1383 $item['key'] .'content_label_positions_y',
1384 [
1385 'label' => __( 'Position Y', 'wpdirectorykit' ),
1386 'type' => Controls_Manager::CHOOSE,
1387 'options' => [
1388 'top' => [
1389 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
1390 'icon' => 'eicon-text-align-top',
1391 ],
1392 'center' => [
1393 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1394 'icon' => 'eicon-text-align-center',
1395 ],
1396 'bottom' => [
1397 'title' => esc_html__( 'Bottom', 'wpdirectorykit' ),
1398 'icon' => 'eicon-text-align-bottom',
1399 ],
1400 ],
1401 'default' => 'left',
1402 'render_type' => 'ui',
1403 'selectors_dictionary' => [
1404 'top' => 'top:0;bottom:initial',
1405 'center' => 'top:50%;transform: translateY(-50%)',
1406 'bottom' => 'top:initial;bottom:0',
1407 ],
1408 'selectors' => [
1409 '{{WRAPPER}} .wdk-listing-card .wdk-thumbnail .wdk-over-image-top' => '{{VALUE}};',
1410 ],
1411 ]
1412 );
1413
1414 $this->add_responsive_control(
1415 $item['key'] .'content_label_positions_x',
1416 [
1417 'label' => __( 'Position X', 'wpdirectorykit' ),
1418 'type' => Controls_Manager::CHOOSE,
1419 'options' => [
1420 'left' => [
1421 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1422 'icon' => 'eicon-text-align-left',
1423 ],
1424 'center' => [
1425 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1426 'icon' => 'eicon-text-align-center',
1427 ],
1428 'right' => [
1429 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1430 'icon' => 'eicon-text-align-right',
1431 ],
1432 ],
1433 'default' => 'left',
1434 'render_type' => 'ui',
1435 'selectors_dictionary' => [
1436 'left' => 'left:0',
1437 'center' => 'left:50%;transform: translateX(-50%)',
1438 'right' => 'left:initial; right:0',
1439 ],
1440 'selectors' => [
1441 '{{WRAPPER}} .wdk-listing-card .wdk-thumbnail .wdk-over-image-top' => '{{VALUE}};',
1442 ],
1443 ]
1444 );
1445 }
1446
1447 if($item['key'] == 'content_type') {
1448 $this->add_responsive_control(
1449 $item['key'] .'content_label_positions_y',
1450 [
1451 'label' => __( 'Position Y', 'wpdirectorykit' ),
1452 'type' => Controls_Manager::CHOOSE,
1453 'options' => [
1454 'top' => [
1455 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
1456 'icon' => 'eicon-text-align-top',
1457 ],
1458 'center' => [
1459 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1460 'icon' => 'eicon-text-align-center',
1461 ],
1462 'bottom' => [
1463 'title' => esc_html__( 'Bottom', 'wpdirectorykit' ),
1464 'icon' => 'eicon-text-align-bottom',
1465 ],
1466 ],
1467 'default' => 'left',
1468 'render_type' => 'ui',
1469 'selectors_dictionary' => [
1470 'top' => 'top:0;bottom:initial',
1471 'center' => 'top:50%;transform: translateY(-50%)',
1472 'bottom' => 'top:initial;bottom:0',
1473 ],
1474 'selectors' => [
1475 '{{WRAPPER}} '.$item['selector'] => '{{VALUE}};',
1476 ],
1477 ]
1478 );
1479
1480 $this->add_responsive_control(
1481 $item['key'] .'content_label_positions_x',
1482 [
1483 'label' => __( 'Position X', 'wpdirectorykit' ),
1484 'type' => Controls_Manager::CHOOSE,
1485 'options' => [
1486 'left' => [
1487 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1488 'icon' => 'eicon-text-align-left',
1489 ],
1490 'center' => [
1491 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1492 'icon' => 'eicon-text-align-center',
1493 ],
1494 'right' => [
1495 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1496 'icon' => 'eicon-text-align-right',
1497 ],
1498 'justify' => [
1499 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
1500 'icon' => 'eicon-text-align-justify',
1501 ],
1502 ],
1503 'default' => 'left',
1504 'render_type' => 'ui',
1505 'selectors_dictionary' => [
1506 'top' => 'justify-content: flex-start;',
1507 'center' => 'justify-content: center;',
1508 'bottom' => 'justify-content: flex-end;',
1509 'justify' => 'justify-content: stretch;',
1510 ],
1511 'selectors' => [
1512 '{{WRAPPER}} '.$item['selector'] => '{{VALUE}};',
1513 ],
1514 ]
1515 );
1516 }
1517 $this->end_controls_section();
1518 }
1519
1520 }
1521
1522 public function enqueue_styles_scripts() {
1523 wp_enqueue_style('slick');
1524 wp_enqueue_style('slick-theme');
1525 wp_enqueue_script('slick');
1526
1527 wp_enqueue_style('wdk-notify');
1528 wp_enqueue_script('wdk-notify');
1529 }
1530 }
1531