PluginProbe
WP Directory Kit / 1.5.4
WP Directory Kit v1.5.4
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.5.4, at elementor-elements/classes/wdk-listing-similar-listings.php

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