PluginProbe
WP Directory Kit / 1.3.1
WP Directory Kit v1.3.1
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / elementor-elements / classes / wdk-listing-agents-listings.php

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

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