PluginProbe
WP Directory Kit / 1.3.0
WP Directory Kit v1.3.0
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-listings-results.php

wdk-listings-results.php in WP Directory Kit 1.3.0, at elementor-elements/classes/wdk-listings-results.php

2,802 lines 116.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 WdkListingsResults 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 parent::__construct($data, $args);
48 }
49
50 /**
51 * Retrieve the widget name.
52 *
53 * @since 1.1.0
54 *
55 * @access public
56 *
57 * @return string Widget name.
58 */
59 public function get_name() {
60 return 'wdk-listings-results';
61 }
62
63 /**
64 * Retrieve the widget title.
65 *
66 * @since 1.1.0
67 *
68 * @access public
69 *
70 * @return string Widget title.
71 */
72 public function get_title() {
73 return esc_html__('Wdk Listings Results', 'wpdirectorykit');
74 }
75
76 /**
77 * Retrieve the widget icon.
78 *
79 * @since 1.1.0
80 *
81 * @access public
82 *
83 * @return string Widget icon.
84 */
85 public function get_icon() {
86 return 'eicon-products';
87 }
88
89 /**
90 * Register the widget controls.
91 *
92 * Adds different input fields to allow the user to change and customize the widget settings.
93 *
94 * @since 1.1.0
95 *
96 * @access protected
97 */
98 protected function register_controls() {
99 $this->generate_controls_conf();
100 $this->generate_controls_layout();
101 $this->generate_controls_styles();
102 $this->generate_controls_content();
103
104 $this->insert_pro_message('tab_conf');
105 parent::register_controls();
106 }
107
108 /**
109 * Render the widget output on the frontend.
110 *
111 * Written in PHP and used to generate the final HTML.
112 *
113 * @since 1.1.0
114 *
115 * @access protected
116 */
117 protected function render() {
118 parent::render();
119 $this->data['id_element'] = $this->get_id();
120 $this->data['settings'] = $this->get_settings();
121
122 $this->data['listings_count'] = 0;
123 $this->data['results'] = array();
124 $this->data['pagination_output'] = '';
125
126 $columns = array('ID', 'location_id', 'category_id', 'post_title', 'post_date', 'search', 'order_by','is_featured', 'address');
127 $external_columns = array('location_id', 'category_id', 'post_title');
128 $custom_parameters = array();
129 $skip_postget = FALSE;
130
131 $custom_parameters['order_by'] = $this->WMVC->db->prefix.'wdk_listings.rank DESC';
132
133 $this->data['custom_order'] = array();
134 if($this->data['settings']['custom_order_list']) {
135 foreach($this->data['settings']['custom_order_list'] as $item){
136 if(empty($item['title']) || empty($item['key'])) continue;
137 $this->data['custom_order'][] = array('title'=>$item['title'],'key'=>$item['key']);
138 }
139 }
140
141 if(!empty($this->data['settings']['specific_user'])) {
142 $custom_parameters['search_agents_ids'] = $this->data['settings']['specific_user'];
143 }
144
145 if($this->data['settings']['conf_results_type'] == 'results_listings') {
146 $controller = 'listing';
147 $offset = NULL;
148
149 if($this->data['settings']['get_filters_enable'] != 'yes')
150 $skip_postget = TRUE;
151
152 if(!isset($_GET['order_by'])) {
153 /* if detected custom field for order */
154 if(!empty($this->data['settings']['conf_order_by_custom'])) {
155 $custom_parameters['order_by'] .= ', '.$this->data['settings']['conf_order_by_custom'].' '.$this->data['settings']['conf_order'];
156 } else {
157 $custom_parameters['order_by'] .= ', '.$this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
158 }
159 }
160
161 if(!empty($this->data['settings']['conf_query'])) {
162 $qr_string = trim($this->data['settings']['conf_query'],'?');
163 $string_par = array();
164 parse_str($qr_string, $string_par);
165 $custom_parameters += array_map('trim', $string_par);
166 }
167 if($this->data['settings']['only_is_featured'] == 'yes') {
168 $custom_parameters['is_featured'] = 'on';
169 }
170
171 if($this->data['settings']['conf_pagination_enable'] == 'yes' && $this->data['settings']['get_filters_enable'] == 'yes') {
172
173 wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters, $skip_postget);
174 $total_items = $this->WMVC->listing_m->total(array('is_activated' => 1,'is_approved'=>1));
175 $current_page = 1;
176 if(isset($_GET['wmvc_paged']))
177 $current_page = intval(wmvc_xss_clean($_GET['wmvc_paged']));
178
179 if(empty($this->data['settings']['per_page']))
180 $this->data['settings']['per_page'] = 6;
181
182 $offset = $this->data['settings']['per_page']*($current_page-1);
183
184 if(function_exists('wdk_wp_frontend_paginate') && $total_items > $this->data['settings']['per_page'])
185 $this->data['pagination_output'] = wdk_wp_frontend_paginate($total_items, $this->data['settings']['per_page'], 'wmvc_paged', array(), TRUE,
186 FALSE, FALSE, $this->data['settings']['limit_pagination']);
187
188 $this->data['listings_count'] = $total_items;
189 } else {
190 wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters, $skip_postget);
191 $total_items = $this->WMVC->listing_m->total(array('is_activated' => 1,'is_approved'=>1));
192
193 $this->data['listings_count'] = $total_items;
194 }
195
196 wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters, $skip_postget);
197
198 $this->data['results'] = $this->WMVC->listing_m->get_pagination($this->data['settings']['per_page'], $offset, array('is_activated' => 1,'is_approved'=>1));
199
200 /*, array('sw_listing.rank DESC')*/
201
202 } else if($this->data['settings']['conf_results_type'] == 'custom_listings') {
203 $listings_ids = array();
204 foreach($this->data['settings']['conf_custom_results'] as $listing) {
205 if(isset($listing['listing_post_id']) && !empty($listing['listing_post_id'])) {
206 $listings_ids [] = $listing['listing_post_id'];
207 }
208 }
209
210 if($this->data['settings']['layout_type'] != 'carousel' && $this->data['settings']['custom_listings_enable_pagination'] == 'yes' && !empty($this->data['settings']['custom_listings_per_page'])) {
211
212 $this->data['listings_count'] = $total_items = 0;
213
214 if(!empty($listings_ids))
215 {
216 $this->WMVC->db->where( $this->WMVC->db->prefix.'wdk_listings.post_id IN(' . implode(',', $listings_ids) . ')', null, false);
217 $total_items = $this->WMVC->listing_m->total(array('is_activated' => 1,'is_approved'=>1));
218 $this->data['listings_count'] = $total_items;
219 }
220
221 $current_page = 1;
222 if(isset($_GET['wmvc_paged']))
223 $current_page = intval(wmvc_xss_clean($_GET['wmvc_paged']));
224
225 $limit = $this->data['settings']['custom_listings_per_page'];
226
227 $offset = $limit *($current_page-1);
228
229 if(function_exists('wdk_wp_frontend_paginate'))
230 $this->data['pagination_output'] = wdk_wp_frontend_paginate($total_items, $limit, 'wmvc_paged', array(), TRUE, FALSE, FALSE,
231 $this->data['settings']['limit_pagination']);
232
233 $this->WMVC->db->limit($limit);
234 $this->WMVC->db->offset($offset);
235 }
236
237 /* where in */
238 if(!empty($listings_ids)){
239 $this->WMVC->db->where( $this->WMVC->db->prefix.'wdk_listings.post_id IN(' . implode(',', $listings_ids) . ')', null, false);
240 $this->WMVC->db->where(array('is_activated' => 1, 'is_approved'=>1));
241 $this->WMVC->db->order_by('FIELD('.$this->WMVC->db->prefix.'wdk_listings.post_id, '. implode(',', $listings_ids) . ')');
242
243 if($this->data['settings']['conf_pagination_enable'] == 'yes' && !empty($this->data['settings']['per_page'])) {
244
245
246 }
247 $this->data['results'] = $this->WMVC->listing_m->get();
248 }
249
250 /* hide filter header on specific results */
251 $this->data['settings']['get_filters_enable'] = '';
252 }
253
254 if(!empty($this->data['results']) && $this->data['listings_count'] == 0)
255 $this->data['listings_count'] = wmvc_count($this->data['results']);
256
257 $this->data['settings']['content_button_icon'] = $this->generate_icon($this->data['settings']['content_button_icon']);
258
259 $this->data['is_edit_mode'] = false;
260 if(Plugin::$instance->editor->is_edit_mode())
261 $this->data['is_edit_mode'] = true;
262
263 if(isset($_GET['wmvc_view_type']) && $this->data['settings']['get_filters_enable'] == 'yes') {
264 if(wmvc_xss_clean($_GET['wmvc_view_type']) == 'grid')
265 $this->data['settings']['layout_type'] = 'grid';
266 if(wmvc_xss_clean($_GET['wmvc_view_type']) == 'list')
267 $this->data['settings']['layout_type'] = 'list';
268 }
269
270 echo $this->view('wdk-listings-results', $this->data);
271 }
272
273
274 private function generate_controls_conf() {
275 $this->start_controls_section(
276 'tab_conf_main_section',
277 [
278 'label' => esc_html__('Main', 'wpdirectorykit'),
279 'tab' => 'tab_conf',
280 ]
281 );
282
283 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')){
284 $this->add_control(
285 'is_ajax_enable',
286 [
287 'label' => __( 'Enable Reload content with ajax', 'wpdirectorykit' ),
288 'type' => \Elementor\Controls_Manager::SWITCHER,
289 'label_on' => __( 'True', 'wpdirectorykit' ),
290 'label_off' => __( 'False', 'wpdirectorykit' ),
291 'return_value' => 'yes',
292 'default' => '',
293
294 ]
295 );
296 }
297
298 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){
299 $this->add_control(
300 'is_custom_layout_enable',
301 [
302 'label' => __( 'Enable Custom Layout', 'wpdirectorykit' ),
303 'type' => \Elementor\Controls_Manager::SWITCHER,
304 'label_on' => __( 'True', 'wpdirectorykit' ),
305 'label_off' => __( 'False', 'wpdirectorykit' ),
306 'return_value' => 'yes',
307 'default' => '',
308
309 ]
310 );
311 $this->add_control(
312 'custom_layout_id_grid',
313 [
314 'label' => __( 'Layout Grid id', 'wpdirectorykit' ),
315 'type' => \Elementor\Controls_Manager::TEXT,
316 'default' => '',
317 'placeholder' => __( 'put your template id', 'wpdirectorykit' ),
318 '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>'),
319 'conditions' => [
320 'terms' => [
321 [
322 'name' => 'is_custom_layout_enable',
323 'operator' => '==',
324 'value' => 'yes',
325 ]
326 ],
327 ],
328 ]
329 );
330
331 $this->add_control (
332 'custom_layout_id_list',
333 [
334 'label' => __( 'Layout List Id', 'wpdirectorykit' ),
335 'type' => \Elementor\Controls_Manager::TEXT,
336 'default' => '',
337 'placeholder' => __( 'put your template id', 'wpdirectorykit' ),
338 '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>'),
339 'conditions' => [
340 'terms' => [
341 [
342 'name' => 'is_custom_layout_enable',
343 'operator' => '==',
344 'value' => 'yes',
345 ]
346 ],
347 ],
348 ]
349 );
350 }
351
352
353 $this->add_control(
354 'specific_user_hr',
355 [
356 'type' => \Elementor\Controls_Manager::DIVIDER,
357 ]
358 );
359
360 $this->add_control(
361 'is_mobile_view_enable',
362 [
363 'label' => __( 'Horizontal mobile view', 'wpdirectorykit' ),
364 'type' => \Elementor\Controls_Manager::SWITCHER,
365 'label_on' => __( 'True', 'wpdirectorykit' ),
366 'label_off' => __( 'False', 'wpdirectorykit' ),
367 'return_value' => 'yes',
368 'default' => '',
369 ]
370 );
371
372 $this->add_control(
373 'conf_results_type',
374 [
375 'label' => __( 'Results type', 'wpdirectorykit' ),
376 'type' => \Elementor\Controls_Manager::SELECT,
377 'default' => 'results_listings',
378 'options' => [
379 'results_listings' => __( 'Results Listings', 'wpdirectorykit' ),
380 'custom_listings' => __( 'Specific Listings', 'wpdirectorykit' ),
381 ],
382 'separator' => 'after',
383 ]
384 );
385
386 $this->add_control(
387 'get_filters_enable',
388 [
389 'label' => __( 'Filtering based on URL enable', 'wpdirectorykit' ),
390 'type' => \Elementor\Controls_Manager::SWITCHER,
391 'label_on' => __( 'True', 'wpdirectorykit' ),
392 'label_off' => __( 'False', 'wpdirectorykit' ),
393 'return_value' => 'yes',
394 'default' => 'yes',
395 'conditions' => [
396 'terms' => [
397 [
398 'name' => 'conf_results_type',
399 'operator' => '==',
400 'value' => 'results_listings',
401 ]
402 ],
403 ],
404 ]
405 );
406
407 $this->add_control(
408 'show_numbers_results_enable',
409 [
410 'label' => __( 'Show number of results Enable', 'wpdirectorykit' ),
411 'type' => \Elementor\Controls_Manager::SWITCHER,
412 'label_on' => __( 'True', 'wpdirectorykit' ),
413 'label_off' => __( 'False', 'wpdirectorykit' ),
414 'return_value' => 'yes',
415 'default' => 'yes',
416 'conditions' => [
417 'terms' => [
418 [
419 'name' => 'conf_results_type',
420 'operator' => '==',
421 'value' => 'results_listings',
422 ]
423 ],
424 ],
425 ]
426 );
427
428 $this->add_control(
429 'view_type_enable',
430 [
431 'label' => __( 'View Type Grid/List Enable', 'wpdirectorykit' ),
432 'type' => \Elementor\Controls_Manager::SWITCHER,
433 'label_on' => __( 'True', 'wpdirectorykit' ),
434 'label_off' => __( 'False', 'wpdirectorykit' ),
435 'return_value' => 'yes',
436 'default' => 'yes',
437 'conditions' => [
438 'terms' => [
439 [
440 'name' => 'conf_results_type',
441 'operator' => '==',
442 'value' => 'results_listings',
443 ]
444 ],
445 ],
446 ]
447 );
448
449 $this->add_control(
450 'sorting_enable',
451 [
452 'label' => __( 'Sorting Filter Enable', 'wpdirectorykit' ),
453 'type' => \Elementor\Controls_Manager::SWITCHER,
454 'label_on' => __( 'True', 'wpdirectorykit' ),
455 'label_off' => __( 'False', 'wpdirectorykit' ),
456 'return_value' => 'yes',
457 'default' => 'yes',
458 'conditions' => [
459 'terms' => [
460 [
461 'name' => 'conf_results_type',
462 'operator' => '==',
463 'value' => 'results_listings',
464 ]
465 ],
466 ],
467 ]
468 );
469
470 $this->add_control(
471 'conf_pagination_enable',
472 [
473 'label' => __( 'Pagination Enable', 'wpdirectorykit' ),
474 'type' => \Elementor\Controls_Manager::SWITCHER,
475 'label_on' => __( 'Show', 'wpdirectorykit' ),
476 'label_off' => __( 'Hide', 'wpdirectorykit' ),
477 'return_value' => 'yes',
478 'default' => '',
479 'description' => esc_html__( 'Filtering based on URL must be enabled for this functionality', 'wpdirectorykit' ),
480 'conditions' => [
481 'terms' => [
482 [
483 'name' => 'conf_results_type',
484 'operator' => '==',
485 'value' => 'results_listings',
486 ],/*
487 [
488 'name' => 'get_filters_enable',
489 'operator' => '==',
490 'value' => 'yes',
491 ]*/
492 ],
493 ]
494 ]
495 );
496
497 $this->add_control(
498 'limit_pagination',
499 [
500 'label' => __('Limit Pagination Items', 'wpdirectorykit'),
501 'type' => Controls_Manager::SELECT,
502 'label_block' => true,
503 'options' => [
504 '1' => __('3 numbers', 'wpdirectorykit'),
505 '2' => __('5 numbers', 'wpdirectorykit'),
506 '3' => __('7 numbers', 'wpdirectorykit'),
507 ],
508 'default' => '1',
509 ]
510 );
511
512 /* conf_results_type :: results_listings */
513 if(true){
514 $this->add_control(
515 'conf_results_type_results_listings_header',
516 [
517 'label' => esc_html__('Results listings', 'wpdirectorykit'),
518 'type' => Controls_Manager::HEADING,
519 'separator' => 'before',
520 'conditions' => [
521 'terms' => [
522 [
523 'name' => 'conf_results_type',
524 'operator' => '==',
525 'value' => 'results_listings',
526 ]
527 ],
528 ],
529 ]
530 );
531
532 $this->add_control(
533 'per_page',
534 [
535 'label' => __( 'Limit Results (Per page)', 'wpdirectorykit' ),
536 'type' => \Elementor\Controls_Manager::NUMBER,
537 'min' => 1,
538 'max' => 250,
539 'step' => 1,
540 'default' => 6,
541 'conditions' => [
542 'terms' => [
543 [
544 'name' => 'conf_results_type',
545 'operator' => '==',
546 'value' => 'results_listings',
547 ]
548 ],
549 ],
550 ]
551 );
552
553 $this->add_control(
554 'only_is_featured',
555 [
556 'label' => __( 'Only show featured', 'wpdirectorykit' ),
557 'type' => \Elementor\Controls_Manager::SWITCHER,
558 'label_on' => __( 'True', 'wpdirectorykit' ),
559 'label_off' => __( 'False', 'wpdirectorykit' ),
560 'return_value' => 'yes',
561 'default' => '',
562 'conditions' => [
563 'terms' => [
564 [
565 'name' => 'conf_results_type',
566 'operator' => '==',
567 'value' => 'results_listings',
568 ]
569 ],
570 ],
571 ]
572 );
573
574 $this->add_control(
575 'conf_query',
576 [
577 'label' => __( 'Query', 'wpdirectorykit' ),
578 'type' => \Elementor\Controls_Manager::TEXTAREA,
579 'rows' => 5,
580 'default' => '',
581 'placeholder' => __( 'Type your query here, example xxx', 'wpdirectorykit' ),
582 'description' => '<span style="word-break: break-all;">'.__( 'Example (same like on url):', 'wpdirectorykit' ).
583 '<br> field_6_min=100&field_6_max=200&field_5=rent&is_featured=on&search_category=3&search_location=4&search_agents_ids=3'.
584 '<br> Listings from date - field_post_date_min=2023-05-07'.
585 '<br> Listings from latest 365 days - field_post_date_min=-365 days'.
586 '</span>',
587 'conditions' => [
588 'terms' => [
589 [
590 'name' => 'conf_results_type',
591 'operator' => '==',
592 'value' => 'results_listings',
593 ]
594 ],
595 ],
596 ]
597 );
598
599
600 $dbusers = get_users( array( 'search' => '',
601 'orderby' => 'display_name', 'order' => 'ASC', 'role__in' => [ 'administrator', 'super-admin','wdk_agent','wdk_agency']));
602
603 $users = array('0'=>esc_html__('Not Selected', 'wpdirectorykit'));
604 foreach($dbusers as $dbuser) {
605 $users[wmvc_show_data('ID', $dbuser)] = '#'.wmvc_show_data('ID', $dbuser).', '.wmvc_show_data('display_name', $dbuser);
606 }
607
608 $this->add_control(
609 'specific_user',
610 [
611 'label' => __( 'Filter by Agent', 'wpdirectorykit' ),
612 'type' => \Elementor\Controls_Manager::SELECT,
613 'default' => '0',
614 'label_block' => true,
615 'options' => $users,
616 ]
617 );
618
619 $this->add_control(
620 'conf_order_by',
621 [
622 'label' => __('Default Sort By Column', 'wpdirectorykit'),
623 'type' => Controls_Manager::SELECT,
624 'label_block' => true,
625 'options' => [
626 'none' => __('None', 'wpdirectorykit'),
627 'post_id' => __('ID', 'wpdirectorykit'),
628 'post_title' => __('Title', 'wpdirectorykit'),
629 ],
630 'default' => 'post_id',
631 'conditions' => [
632 'terms' => [
633 [
634 'name' => 'conf_results_type',
635 'operator' => '==',
636 'value' => 'results_listings',
637 ]
638 ],
639 ],
640 ]
641 );
642
643 $this->add_control(
644 'conf_order_by_custom',
645 [
646 'label' => __('Default Custom Sort By', 'wpdirectorykit'),
647 'description' => __('Custom Sort By', 'wpdirectorykit'),
648 'description' => '<span style="word-break: break-all;">'.__( 'Example:', 'wpdirectorykit' ).
649 '<br> RAND() - return random results'.
650 '<br> field_13_NUMBER - where 13 is field id, NUMBER - field type'.
651 '<br> field_4_NUMBER - where 4 is field id, NUMBER - field type'.
652 '<br> field_6_DROPDOWN - where 6 is field id, DROPDOWN - field type'.
653 '<br> category_title - Category Title'.
654 '<br> location_title - Location Title'.
655 '</span>',
656 'type' => Controls_Manager::TEXT,
657 'label_block' => true,
658 'default' => 'post_id',
659 'conditions' => [
660 'terms' => [
661 [
662 'name' => 'conf_results_type',
663 'operator' => '==',
664 'value' => 'results_listings',
665 ]
666 ],
667 ],
668 ]
669 );
670
671
672 $this->add_control(
673 'conf_order',
674 [
675 'label' => __('Default Listing Order', 'wpdirectorykit'),
676 'type' => Controls_Manager::SELECT,
677 'label_block' => true,
678 'options' => [
679 'asc' => __('Ascending', 'wpdirectorykit'),
680 'desc' => __('Descending', 'wpdirectorykit')
681 ],
682 'default' => 'desc',
683 'conditions' => [
684 'terms' => [
685 [
686 'name' => 'conf_results_type',
687 'operator' => '==',
688 'value' => 'results_listings',
689 ]
690 ],
691 ],
692 ]
693 );
694 }
695
696 if(true) {
697
698
699 $this->add_control(
700 'conf_results_type_custom_listings_header',
701 [
702 'label' => esc_html__('Custom listings', 'wpdirectorykit'),
703 'type' => Controls_Manager::HEADING,
704 'separator' => 'before',
705 'conditions' => [
706 'terms' => [
707 [
708 'name' => 'conf_results_type',
709 'operator' => '==',
710 'value' => 'custom_listings',
711 ]
712 ],
713 ],
714 ]
715 );
716
717 $this->add_control(
718 'custom_listings_enable_pagination',
719 [
720 'label' => __( 'Enable Pagination', 'wpdirectorykit' ),
721 'type' => \Elementor\Controls_Manager::SWITCHER,
722 'label_on' => __( 'True', 'wpdirectorykit' ),
723 'label_off' => __( 'False', 'wpdirectorykit' ),
724 'return_value' => 'yes',
725 'default' => '',
726 'conditions' => [
727 'terms' => [
728 [
729 'name' => 'conf_results_type',
730 'operator' => '==',
731 'value' => 'custom_listings',
732 ]
733 ],
734 ],
735 ]
736 );
737
738 $this->add_control(
739 'custom_listings_per_page',
740 [
741 'label' => __( 'Limit Listings (Per page)', 'wpdirectorykit' ),
742 'type' => \Elementor\Controls_Manager::NUMBER,
743 'min' => 1,
744 'max' => 50,
745 'step' => 1,
746 'default' => 6,
747 'conditions' => [
748 'terms' => [
749 [
750 'name' => 'conf_results_type',
751 'operator' => '==',
752 'value' => 'custom_listings',
753 ],
754 [
755 'name' => 'custom_listings_enable_pagination',
756 'operator' => '==',
757 'value' => 'yes',
758 ]
759 ],
760 ],
761 ]
762 );
763
764
765 if(true){
766 $repeater = new Repeater();
767 $repeater->start_controls_tabs( 'listings' );
768 $repeater->add_control(
769 'listing_post_id',
770 [
771 'label' => __( 'ID Post Listing', 'wpdirectorykit' ),
772 'type' => \Elementor\Controls_Manager::NUMBER,
773 'min' => 1,
774 'step' => 1,
775 ]
776 );
777 $repeater->end_controls_tabs();
778
779
780 $this->add_control(
781 'conf_custom_results',
782 [
783 'type' => Controls_Manager::REPEATER,
784 'fields' => $repeater->get_controls(),
785 'default' => [
786 ],
787 'title_field' => '{{{ listing_post_id }}}',
788 'conditions' => [
789 'terms' => [
790 [
791 'name' => 'conf_results_type',
792 'operator' => '==',
793 'value' => 'custom_listings',
794 ]
795 ],
796 ],
797 ]
798 );
799
800 }
801 }
802
803 $this->add_control(
804 'important_note',
805 [
806 'label' => '',
807 'type' => \Elementor\Controls_Manager::RAW_HTML,
808 'raw' => wdk_sprintf(__( 'Edit Result Card Designer <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_resultitem')),
809 'content_classes' => 'wdk_elementor_hint',
810 ]
811 );
812
813 $this->end_controls_section();
814
815 $this->start_controls_section(
816 'tab_conf_main_section_order',
817 [
818 'label' => esc_html__('Custom Sort', 'wpdirectorykit'),
819 'tab' => 'tab_conf',
820 ]
821 );
822
823 $repeater_order = new Repeater();
824 $repeater_order->start_controls_tabs( 'orders' );
825 $repeater_order->add_control(
826 'key',
827 [
828 'label' => __( 'Sort Key', 'wpdirectorykit' ),
829 'type' => \Elementor\Controls_Manager::TEXT,
830 'placeholder' => 'post_id ASC',
831 'description' => '<span style="word-break: break-all;">'.__( 'Custom Fields Order Example:', 'wpdirectorykit' ).
832 '<br> field_13_NUMBER ASC - where 13 is field id, NUMBER - field type'.
833 '<br> field_4_NUMBER DESC - where 4 is field id, NUMBER - field type'.
834 '<br> field_6_DROPDOWN ASC - where 6 is field id, DROPDOWN - field type'.
835 '<br> category_title - Category Title'.
836 '<br> location_title - Location Title'.
837 '</span>',
838 ]
839 );
840 $repeater_order->add_control(
841 'title',
842 [
843 'label' => __( 'Title', 'wpdirectorykit' ),
844 'type' => \Elementor\Controls_Manager::TEXT,
845 'placeholder' => __( 'Title', 'wpdirectorykit' ),
846 ]
847 );
848 $repeater_order->end_controls_tabs();
849
850 $this->add_control(
851 'custom_order_list',
852 [
853 'type' => Controls_Manager::REPEATER,
854 'fields' => $repeater_order->get_controls(),
855 'default' => [
856 ],
857 'title_field' => '{{{ title }}}',
858 ]
859 );
860
861 $this->end_controls_section();
862
863
864 if(wdk_get_option('wdk_sub_listings_enable')) {
865
866 $this->start_controls_section(
867 'tab_conf_main_section_subslistings',
868 [
869 'label' => esc_html__('Related Listings', 'wpdirectorykit'),
870 'tab' => 'tab_conf',
871 ]
872 );
873
874 $fields_data = wdk_cached_field_get();
875 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
876 $order_i = 0;
877
878 $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
879 $fields_list [(++$order_i).'__idlisting'] = esc_html__('Id listing', 'wpdirectorykit');
880 $fields_list [(++$order_i).'__post_id'] = esc_html__('Post Id', 'wpdirectorykit');
881 $fields_list [(++$order_i).'__counter_views'] = esc_html__('Views counter', 'wpdirectorykit');
882 $fields_list [(++$order_i).'__lat'] = esc_html__('Gps Lat', 'wpdirectorykit');
883 $fields_list [(++$order_i).'__lng'] = esc_html__('Gps Lng', 'wpdirectorykit');
884 $fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit');
885 $fields_list [(++$order_i).'__date_modified'] = esc_html__('Date Modified', 'wpdirectorykit');
886 $fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit');
887 $fields_list [(++$order_i).'__post_content'] = esc_html__('WP Content', 'wpdirectorykit');
888 $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit');
889 $fields_list [(++$order_i).'__category_id'] = esc_html__('Category', 'wpdirectorykit');
890 $fields_list [(++$order_i).'__location_id'] = esc_html__('Location', 'wpdirectorykit');
891
892 foreach($fields_data as $field)
893 {
894 if(wmvc_show_data('field_type', $field) == 'SECTION') {
895 $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --';
896 } else {
897 $fields_list[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
898 }
899 }
900
901 $this->add_responsive_control(
902 'related_fields_header',
903 [
904 'label' => esc_html__('Fields', 'wpdirectorykit'),
905 'type' => Controls_Manager::HEADING,
906 ]
907 );
908
909 $this->add_control(
910 'related_fields_header_hr',
911 [
912 'type' => \Elementor\Controls_Manager::DIVIDER,
913 ]
914 );
915
916 $repeater_sublistings_fields = new Repeater();
917 $repeater_sublistings_fields->start_controls_tabs( 'related_fields' );
918 $repeater_sublistings_fields->add_control(
919 'field',
920 [
921 'label' => __( 'Field', 'wpdirectorykit' ),
922 'type' => \Elementor\Controls_Manager::SELECT,
923 'options' => $fields_list,
924 ]
925 );
926
927 $repeater_sublistings_fields->add_control(
928 'is_stars',
929 [
930 'label' => __( 'Show like stars', 'wpdirectorykit' ),
931 'type' => \Elementor\Controls_Manager::SWITCHER,
932 'label_on' => __( 'On', 'wpdirectorykit' ),
933 'label_off' => __( 'Off', 'wpdirectorykit' ),
934 'return_value' => 'yes',
935 'default' => '',
936 'description' => esc_html__( 'Numeric values required', 'wpdirectorykit' ),
937 ]
938 );
939
940 $repeater_sublistings_fields->add_control(
941 'is_link',
942 [
943 'label' => __( 'Set field like link', 'wpdirectorykit' ),
944 'type' => \Elementor\Controls_Manager::SWITCHER,
945 'label_on' => __( 'On', 'wpdirectorykit' ),
946 'label_off' => __( 'Off', 'wpdirectorykit' ),
947 'return_value' => 'yes',
948 'default' => 'yes',
949 ]
950 );
951
952 $repeater_sublistings_fields->end_controls_tabs();
953
954 $this->add_control(
955 'related_fields_list',
956 [
957 'label' => esc_html__('Fields For Query Similar Listings', 'wpdirectorykit'),
958 'type' => Controls_Manager::REPEATER,
959 'fields' => $repeater_sublistings_fields->get_controls(),
960 'default' => [
961 [
962 'field' => '63',
963 'is_stars' => 'yes',
964 'is_link' => '',
965 ],
966 [
967 'field' => 'post_title',
968 'is_link' => 'yes',
969 ],
970 [
971 'field' => '64',
972 'is_link' => '',
973 ],
974 ],
975 'title_field' => '{{{ field }}}',
976 ]
977 );
978
979 $this->add_control(
980 'related_fields_header_hr2',
981 [
982 'type' => \Elementor\Controls_Manager::DIVIDER,
983 ]
984 );
985
986 $this->add_responsive_control(
987 'related_fields_border',
988 [
989 'label' => esc_html__('Line Bottom', 'wpdirectorykit'),
990 'type' => Controls_Manager::HEADING,
991 ]
992 );
993
994 $this->add_control(
995 'related_fields_border_width',
996 [
997 'label' => __( 'Speed', 'wpdirectorykit' ),
998 'type' => \Elementor\Controls_Manager::NUMBER,
999 'min' => 0,
1000 'max' => 10,
1001 'step' => 1,
1002 'default' => 1,
1003 'selectors' => [
1004 '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part ul > li:not(:last-child)' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
1005 ],
1006 ]
1007 );
1008
1009 $this->add_responsive_control(
1010 'related_fields_border_color',
1011 [
1012 'label' => esc_html__( 'Color', 'wpdirectorykit' ),
1013 'type' => Controls_Manager::COLOR,
1014 'selectors' => [
1015 '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part ul > li:not(:last-child)' => 'border-bottom-color: {{VALUE}};',
1016 ],
1017 ]
1018 );
1019
1020 $this->add_responsive_control(
1021 'related_fields_styles',
1022 [
1023 'label' => esc_html__('Styles', 'wpdirectorykit'),
1024 'type' => Controls_Manager::HEADING,
1025 ]
1026 );
1027
1028 $this->add_control(
1029 'related_fields_header_hr3',
1030 [
1031 'type' => \Elementor\Controls_Manager::DIVIDER,
1032 ]
1033 );
1034
1035 $selectors = array(
1036 'normal' => '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part a, {{WRAPPER}} .wdk-listing-card .wdk-sublistings-part span',
1037 'hover'=>'{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part a%1$s'
1038 );
1039 $this->generate_renders_tabs($selectors, 'related_fields_dynamic', ['color','typo','padding','shadow','transition']);
1040
1041 $this->add_control(
1042 'related_fields_part_styles',
1043 [
1044 'label' => esc_html__('Card Part', 'wpdirectorykit'),
1045 'type' => Controls_Manager::HEADING,
1046 ]
1047 );
1048
1049 $this->add_control(
1050 'related_fields_header_hr4',
1051 [
1052 'type' => \Elementor\Controls_Manager::DIVIDER,
1053 ]
1054 );
1055
1056 $selectors = array(
1057 'normal' => '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part',
1058 );
1059 $this->generate_renders_tabs($selectors, 'related_fields_part_dynamic', ['margin','background','border','border_radius','padding','shadow','transition']);
1060
1061 $this->add_control(
1062 'related_fields_star_styles',
1063 [
1064 'label' => esc_html__('Stars', 'wpdirectorykit'),
1065 'type' => Controls_Manager::HEADING,
1066 ]
1067 );
1068
1069 $this->add_control(
1070 'related_fields_header_hr5',
1071 [
1072 'type' => \Elementor\Controls_Manager::DIVIDER,
1073 ]
1074 );
1075
1076 $selectors = array(
1077 'active' => '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part .stars-lst span i.star-active',
1078 'deactive' => '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part .stars-lst span i.innactive',
1079 );
1080 $this->generate_renders_tabs($selectors, 'related_fields_star_dynamic', ['margin','padding','font-size', 'color']);
1081
1082 $this->end_controls_section();
1083 }
1084 }
1085
1086 private function generate_controls_layout() {
1087 $this->start_controls_section(
1088 'tab_content',
1089 [
1090 'label' => esc_html__('Basic', 'wpdirectorykit'),
1091 'tab' => 'tab_layout',
1092 ]
1093 );
1094
1095 $this->add_control(
1096 'layout_type',
1097 [
1098 'label' => __( 'Layout Type', 'wpdirectorykit' ),
1099 'type' => \Elementor\Controls_Manager::SELECT,
1100 'default' => 'grid',
1101 'options' => [
1102 'grid' => __( 'Grid', 'wpdirectorykit' ),
1103 'list' => __( 'List', 'wpdirectorykit' ),
1104 'carousel' => __( 'Carousel', 'wpdirectorykit' ),
1105 ],
1106 ]
1107 );
1108
1109
1110 $this->add_control(
1111 'enable_separed_styles',
1112 [
1113 'label' => __( 'Different styles for grid/list', 'wpdirectorykit' ),
1114 'type' => \Elementor\Controls_Manager::SWITCHER,
1115 'label_on' => __( 'On', 'wpdirectorykit' ),
1116 'label_off' => __( 'Off', 'wpdirectorykit' ),
1117 'return_value' => 'true',
1118 'default' => '',
1119 'conditions' => [
1120 'relation' => 'or',
1121 'terms' => [
1122 [
1123 'name' => 'layout_type',
1124 'operator' => '==',
1125 'value' => 'grid',
1126 ],
1127 [
1128 'name' => 'layout_type',
1129 'operator' => '==',
1130 'value' => 'list',
1131 ]
1132 ],
1133 ],
1134 ]
1135 );
1136
1137 $this->add_responsive_control(
1138 'row_gap_col',
1139 [
1140 'label' => __( 'Columns', 'wpdirectorykit' ),
1141 'type' => Controls_Manager::SELECT,
1142 'options' => [
1143 '' => esc_html__('Default', 'wpdirectorykit'),
1144 'auto' => esc_html__('Auto', 'wpdirectorykit'),
1145 '100%' => '1',
1146 '50%' => '2',
1147 'calc(100% / 3)' => '3',
1148 '25%' => '4',
1149 '20%' => '5',
1150 'auto_flexible' => 'auto flexible',
1151 ],
1152 'selectors_dictionary' => [
1153 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1154 '100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%',
1155 '50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%',
1156 'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)',
1157 '25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%',
1158 '20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%',
1159 'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto',
1160 'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto',
1161 ],
1162 'selectors' => [
1163 '{{WRAPPER}} .wdk-row .wdk-col' => '{{UNIT}}',
1164 ],
1165 'default' => 'calc(100% / 3)',
1166 'separator' => 'before',
1167 'conditions' => [
1168 'terms' => [
1169 [
1170 'name' => 'layout_type',
1171 'operator' => '==',
1172 'value' => 'grid',
1173 ]
1174 ],
1175 ],
1176 ]
1177 );
1178
1179 $this->add_responsive_control(
1180 'column_gap',
1181 [
1182 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
1183 'type' => Controls_Manager::SLIDER,
1184 'default' => [
1185 'size' => 10,
1186 ],
1187 'range' => [
1188 'px' => [
1189 'min' => 0,
1190 'max' => 60,
1191 ],
1192 ],
1193 'selectors' => [
1194 '{{WRAPPER}} .wdk-row .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
1195 '{{WRAPPER}} .wdk-row' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
1196 ],
1197 'conditions' => [
1198 'terms' => [
1199 [
1200 'name' => 'layout_type',
1201 'operator' => '==',
1202 'value' => 'grid',
1203 ],
1204 ],
1205 ],
1206 ]
1207 );
1208
1209 $this->add_responsive_control(
1210 'row_gap',
1211 [
1212 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
1213 'type' => Controls_Manager::SLIDER,
1214 'default' => [
1215 'size' => 10,
1216 ],
1217 'range' => [
1218 'px' => [
1219 'min' => 0,
1220 'max' => 60,
1221 ],
1222 ],
1223 'selectors' => [
1224 '{{WRAPPER}} .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1225 '{{WRAPPER}} .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
1226 ],
1227 'conditions' => [
1228 'terms' => [
1229 [
1230 'name' => 'layout_type',
1231 'operator' => '!=',
1232 'value' => 'carousel',
1233 ]
1234 ],
1235 ],
1236 ]
1237 );
1238
1239 $this->add_responsive_control(
1240 'thumbnail_width',
1241 [
1242 'label' => esc_html__('Thumbnail width (For List Version)', 'wpdirectorykit'),
1243 'type' => Controls_Manager::SLIDER,
1244 'default' => [
1245 'size' => 270,
1246 'unit' => 'px',
1247 ],
1248 'size_units' => [ 'px', '%' ],
1249 'range' => [
1250 'px' => [
1251 'min' => 0,
1252 'max' => 600,
1253 ],
1254 '%' => [
1255 'min' => 0,
1256 'max' => 100,
1257 ],
1258 ],
1259 'selectors' => [
1260 '{{WRAPPER}} .wdk-element .wdk-listing-card.list .wdk-thumbnail' => 'flex: 0 0 {{SIZE}}{{UNIT}};',
1261 ],
1262 'conditions' => [
1263 'terms' => [
1264 [
1265 'name' => 'layout_type',
1266 'operator' => '==',
1267 'value' => 'list',
1268 ]
1269 ],
1270 ],
1271 ]
1272 );
1273
1274 /* Carousel Grid Config */
1275 if(true) {
1276 $this->add_responsive_control(
1277 'carousel_column_gap_carousel',
1278 [
1279 'label' => esc_html__('Slider Gap', 'wpdirectorykit'),
1280 'type' => Controls_Manager::SLIDER,
1281 'range' => [
1282 'px' => [
1283 'min' => 0,
1284 'max' => 60,
1285 ],
1286 ],
1287 'selectors' => [
1288 '{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini ' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};',
1289 ],
1290 'conditions' => [
1291 'terms' => [
1292 [
1293 'name' => 'layout_type',
1294 'operator' => '==',
1295 'value' => 'carousel',
1296 ]
1297 ],
1298 ],
1299 ]
1300 );
1301
1302 $this->add_responsive_control (
1303 'carousel_column_gap',
1304 [
1305 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
1306 'type' => Controls_Manager::SLIDER,
1307 'default' => [
1308 'size' => 10,
1309 ],
1310 'range' => [
1311 'px' => [
1312 'min' => 0,
1313 'max' => 60,
1314 ],
1315 ],
1316 'selectors' => [
1317 '{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};',
1318 '{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
1319 ],
1320 'conditions' => [
1321 'terms' => [
1322 [
1323 'name' => 'layout_type',
1324 'operator' => '==',
1325 'value' => 'carousel',
1326 ]
1327 ],
1328 ],
1329 ]
1330 );
1331
1332 $this->add_responsive_control(
1333 'carousel_column_gap_top',
1334 [
1335 'label' => esc_html__('Columns Gap Top', 'wpdirectorykit'),
1336 'type' => Controls_Manager::SLIDER,
1337 'default' => [
1338 'size' => 0,
1339 ],
1340 'range' => [
1341 'px' => [
1342 'min' => 0,
1343 'max' => 60,
1344 ],
1345 ],
1346 'selectors' => [
1347 '{{WRAPPER}} .wdk_results_listings_slider_box' => 'padding-top: {{SIZE}}{{UNIT}};',
1348 ],
1349 'conditions' => [
1350 'terms' => [
1351 [
1352 'name' => 'layout_type',
1353 'operator' => '==',
1354 'value' => 'carousel',
1355 ]
1356 ],
1357 ],
1358 ]
1359 );
1360
1361 $this->add_responsive_control(
1362 'carousel_column_gap_bottom',
1363 [
1364 'label' => esc_html__('Columns Gap Bottom', 'wpdirectorykit'),
1365 'type' => Controls_Manager::SLIDER,
1366 'default' => [
1367 'size' => 10,
1368 ],
1369 'range' => [
1370 'px' => [
1371 'min' => 0,
1372 'max' => 60,
1373 ],
1374 ],
1375 'selectors' => [
1376 '{{WRAPPER}} .wdk_results_listings_slider_box' => 'padding-bottom: {{SIZE}}{{UNIT}};',
1377 ],
1378 'conditions' => [
1379 'terms' => [
1380 [
1381 'name' => 'layout_type',
1382 'operator' => '==',
1383 'value' => 'carousel',
1384 ]
1385 ],
1386 ],
1387 ]
1388 );
1389 }
1390
1391 $this->add_control(
1392 'basic_el_header_1',
1393 [
1394 'label' => esc_html__('Text', 'wpdirectorykit'),
1395 'type' => Controls_Manager::HEADING,
1396 'separator' => 'before',
1397 ]
1398 );
1399
1400 $this->add_control(
1401 'content_button_text',
1402 [
1403 'label' => __( 'Button Open Text', 'wpdirectorykit' ),
1404 'type' => \Elementor\Controls_Manager::TEXT,
1405 'default' => '',
1406 ]
1407 );
1408
1409 $this->add_responsive_control(
1410 'thumbn_slider_h',
1411 [
1412 'label' => esc_html__('Thumbnail Slider', 'wpdirectorykit'),
1413 'type' => Controls_Manager::HEADING,
1414 'separator' => 'before',
1415 ]
1416 );
1417
1418 $this->add_responsive_control(
1419 'thumbn_slider_arrow_left',
1420 [
1421 'label' => esc_html__('Icon Left', 'wpdirectorykit'),
1422 'type' => Controls_Manager::ICONS,
1423 'label_block' => true,
1424 ]
1425 );
1426
1427 $this->add_responsive_control(
1428 'thumbn_slider_arrow_right',
1429 [
1430 'label' => esc_html__('Icon Right', 'wpdirectorykit'),
1431 'type' => Controls_Manager::ICONS,
1432 'label_block' => true,
1433 ]
1434 );
1435
1436 $this->end_controls_section();
1437
1438 $this->start_controls_section(
1439 'layout_carousel_sec',
1440 [
1441 'label' => esc_html__('Carousel Options', 'wpdirectorykit'),
1442 'tab' => 'tab_layout',
1443 'conditions' => [
1444 'terms' => [
1445 [
1446 'name' => 'layout_type',
1447 'operator' => '==',
1448 'value' => 'carousel',
1449 ]
1450 ],
1451 ],
1452 ]
1453 );
1454
1455 $this->add_control(
1456 'layout_carousel_is_infinite',
1457 [
1458 'label' => __( 'Infinite', 'wpdirectorykit' ),
1459 'type' => \Elementor\Controls_Manager::SWITCHER,
1460 'label_on' => __( 'On', 'wpdirectorykit' ),
1461 'label_off' => __( 'Off', 'wpdirectorykit' ),
1462 'return_value' => 'true',
1463 'default' => 'true',
1464 ]
1465 );
1466
1467 $this->add_control(
1468 'layout_carousel_is_autoplay',
1469 [
1470 'label' => __( 'Autoplay', 'wpdirectorykit' ),
1471 'type' => \Elementor\Controls_Manager::SWITCHER,
1472 'label_on' => __( 'On', 'wpdirectorykit' ),
1473 'label_off' => __( 'Off', 'wpdirectorykit' ),
1474 'return_value' => 'true',
1475 'default' => '',
1476 ]
1477 );
1478
1479 $this->add_control(
1480 'layout_carousel_speed',
1481 [
1482 'label' => __( 'Speed', 'wpdirectorykit' ),
1483 'type' => \Elementor\Controls_Manager::NUMBER,
1484 'min' => 0,
1485 'max' => 100000,
1486 'step' => 100,
1487 'default' => 500,
1488 ]
1489 );
1490
1491 $this->add_control(
1492 'layout_carousel_animation_style',
1493 [
1494 'label' => __( 'Animation Style', 'wpdirectorykit' ),
1495 'type' => \Elementor\Controls_Manager::SELECT,
1496 'default' => 'fade',
1497 'options' => [
1498 'slide' => __( 'Slide', 'wpdirectorykit' ),
1499 'fade' => __( 'Fade', 'wpdirectorykit' ),
1500 'fade_in_in' => __( 'Fade in', 'wpdirectorykit' ),
1501 ],
1502 ]
1503 );
1504
1505 $this->add_control(
1506 'layout_carousel_cssease',
1507 [
1508 'label' => __( 'cssEase', 'wpdirectorykit' ),
1509 'type' => \Elementor\Controls_Manager::SELECT,
1510 'default' => 'linear',
1511 'options' => [
1512 'linear' => __( 'linear', 'wpdirectorykit' ),
1513 'ease' => __( 'ease', 'wpdirectorykit' ),
1514 'ease-in' => __( 'ease-in', 'wpdirectorykit' ),
1515 'ease-out' => __( 'ease-out', 'wpdirectorykit' ),
1516 'ease-in-out' => __( 'ease-in-out', 'wpdirectorykit' ),
1517 'step-start' => __( 'step-start', 'wpdirectorykit' ),
1518 'step-end' => __( 'step-end', 'wpdirectorykit' ),
1519 ],
1520 ]
1521 );
1522
1523 $this->add_responsive_control(
1524 'layout_carousel_columns',
1525 [
1526 'label' => __( 'Count grid', 'wpdirectorykit' ),
1527 'type' => \Elementor\Controls_Manager::NUMBER,
1528 'min' => 1,
1529 'max' => 10,
1530 'step' => 1,
1531 'default' => 3,
1532 ]
1533 );
1534
1535 $this->end_controls_section();
1536
1537 }
1538
1539 private function generate_controls_styles() {
1540
1541 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){
1542 $this->start_controls_section(
1543 'sstyles_thmbn_section',
1544 [
1545 'label' => esc_html__('Section Image', 'wpdirectorykit'),
1546 'tab' => Controls_Manager::TAB_STYLE,
1547 'conditions' => [
1548 'terms' => [
1549 [
1550 'name' => 'is_custom_layout_enable',
1551 'operator' => '!=',
1552 'value' => 'yes',
1553 ]
1554 ],
1555 ],
1556 ]
1557 );
1558 } else {
1559 $this->start_controls_section(
1560 'sstyles_thmbn_section',
1561 [
1562 'label' => esc_html__('Section Image', 'wpdirectorykit'),
1563 'tab' => Controls_Manager::TAB_STYLE,
1564 ]
1565 );
1566 }
1567
1568 $this->add_responsive_control(
1569 'styles_thmbn_des_type',
1570 [
1571 'label' => __( 'Design type', 'wpdirectorykit' ),
1572 'type' => \Elementor\Controls_Manager::SELECT,
1573 'default' => 'wdk_size_image_cover',
1574 'options' => [
1575 'wdk_size_image_ori' => __( 'Default Sizes', 'wpdirectorykit' ),
1576 'wdk_size_image_cover' => __( 'Image auto crop/resize', 'wpdirectorykit' ),
1577 ],
1578 ]
1579 );
1580
1581 $this->add_responsive_control(
1582 'styles_thmbn_des_height',
1583 [
1584 'label' => esc_html__('Height Grid View', 'wpdirectorykit'),
1585 'type' => Controls_Manager::SLIDER,
1586 'range' => [
1587 'px' => [
1588 'min' => 50,
1589 'max' => 1500,
1590 ],
1591 'vw' => [
1592 'min' => 0,
1593 'max' => 100,
1594 ],
1595 '%' => [
1596 'min' => 0,
1597 'max' => 100,
1598 ],
1599 ],
1600 'size_units' => [ 'px', 'vw','%' ],
1601 'default' => [
1602 'size' => 350,
1603 'unit' => 'px',
1604 ],
1605 'selectors' => [
1606 '{{WRAPPER}} .wdk-listings-results.wdk_size_image_cover .wdk-listing-card:not(.list) .wdk-thumbnail .wdk-image' => 'height: {{SIZE}}{{UNIT}}',
1607 ],
1608 'conditions' => [
1609 'relation' => 'or',
1610 'terms' => [
1611 [
1612 'name' => 'styles_thmbn_des_type',
1613 'operator' => '==',
1614 'value' => 'wdk_size_image_cover',
1615 ],
1616 [
1617 'name' => 'styles_thmbn_des_type',
1618 'operator' => '==',
1619 'value' => 'wdk_image_cover',
1620 ]
1621 ],
1622 ]
1623 ]
1624 );
1625
1626 if(false)
1627 $this->add_responsive_control(
1628 'styles_thmbn_des_height_list',
1629 [
1630 'label' => esc_html__('Height List view', 'wpdirectorykit'),
1631 'type' => Controls_Manager::SLIDER,
1632 'range' => [
1633 'px' => [
1634 'min' => 50,
1635 'max' => 1500,
1636 ],
1637 'vw' => [
1638 'min' => 0,
1639 'max' => 100,
1640 ],
1641 ],
1642 'size_units' => [ 'px', 'vw'],
1643 'selectors' => [
1644 '{{WRAPPER}} .wdk-listings-results.wdk_size_image_cover .wdk-listing-card.list .wdk-thumbnail' => 'height: {{SIZE}}{{UNIT}}',
1645 ],
1646 'separator' => 'after',
1647 'conditions' => [
1648 'relation' => 'or',
1649 'terms' => [
1650 [
1651 'name' => 'styles_thmbn_des_type',
1652 'operator' => '==',
1653 'value' => 'wdk_size_image_cover',
1654 ],
1655 [
1656 'name' => 'styles_thmbn_des_type',
1657 'operator' => '==',
1658 'value' => 'wdk_image_cover',
1659 ]
1660 ],
1661 ]
1662 ]
1663 );
1664
1665 $this->end_controls_section();
1666
1667 $this->start_controls_section(
1668 'styles_carousel_arrows_section',
1669 [
1670 'label' => esc_html__('Carousel Arrows', 'wpdirectorykit'),
1671 'tab' => Controls_Manager::TAB_STYLE,
1672 'conditions' => [
1673 'terms' => [
1674 [
1675 'name' => 'layout_type',
1676 'operator' => '==',
1677 'value' => 'carousel',
1678 ]
1679 ],
1680 ],
1681 ]
1682 );
1683
1684 $this->add_responsive_control(
1685 'styles_carousel_arrows_hide',
1686 [
1687 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1688 'type' => Controls_Manager::SWITCHER,
1689 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1690 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1691 'return_value' => 'none',
1692 'default' => '',
1693 'selectors' => [
1694 '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows' => 'display: {{VALUE}};',
1695 ],
1696 ]
1697 );
1698
1699 $this->add_responsive_control(
1700 'styles_carousel_arrows_position',
1701 [
1702 'label' => __( 'Position', 'wpdirectorykit' ),
1703 'type' => \Elementor\Controls_Manager::SELECT,
1704 'default' => 'wdk_slider_arrows_bottom',
1705 'options' => [
1706 'wdk_slider_arrows_bottom' => __( 'Bottom', 'wpdirectorykit' ),
1707 'wdk_slider_arrows_middle' => __( 'Center', 'wpdirectorykit' ),
1708 'wdk_slider_arrows_top' => __( 'Top', 'wpdirectorykit' ),
1709 ],
1710 ]
1711 );
1712
1713 if(false)
1714 $this->add_responsive_control(
1715 'styles_carousel_arrows_position_style',
1716 [
1717 'label' => __( 'Position Style', 'wpdirectorykit' ),
1718 'type' => \Elementor\Controls_Manager::SELECT,
1719 'default' => 'wdk_slider_arrows_out',
1720 'options' => [
1721 'wdk_slider_arrows_out' => __( 'Out', 'wpdirectorykit' ),
1722 'wdk_slider_arrows_in' => __( 'In', 'wpdirectorykit' ),
1723 ],
1724 ]
1725 );
1726
1727 $this->add_responsive_control(
1728 'styles_carousel_arrows_align',
1729 [
1730 'label' => __( 'Align', 'wpdirectorykit' ),
1731 'type' => Controls_Manager::CHOOSE,
1732 'options' => [
1733 'left' => [
1734 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1735 'icon' => 'eicon-text-align-left',
1736 ],
1737 'center' => [
1738 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1739 'icon' => 'eicon-text-align-center',
1740 ],
1741 'right' => [
1742 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1743 'icon' => 'eicon-text-align-right',
1744 ],
1745 'justify' => [
1746 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
1747 'icon' => 'eicon-text-align-justify',
1748 ],
1749 ],
1750 'render_type' => 'ui',
1751 'selectors_dictionary' => [
1752 'left' => 'justify-content: flex-start;',
1753 'center' => 'justify-content: center;',
1754 'right' => 'justify-content: flex-end;',
1755 'justify' => 'justify-content: space-between;',
1756 ],
1757 'selectors' => [
1758 '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows' => '{{VALUE}};',
1759 ],
1760 'conditions' => [
1761 'terms' => [
1762 [
1763 'name' => 'styles_carousel_arrows_position',
1764 'operator' => '!=',
1765 'value' => 'wdk_slider_arrows_middle',
1766 ]
1767 ],
1768 ],
1769 ]
1770 );
1771
1772 $this->add_responsive_control(
1773 'styles_carousel_arrows_icon_left_h',
1774 [
1775 'label' => esc_html__('Arrow left', 'wpdirectorykit'),
1776 'type' => Controls_Manager::HEADING,
1777 'separator' => 'before',
1778 ]
1779 );
1780
1781 $this->add_responsive_control(
1782 'styles_carousel_arrows_s_m_left_margin',
1783 [
1784 'label' => esc_html__( 'Margin', 'wpdirectorykit' ),
1785 'type' => Controls_Manager::DIMENSIONS,
1786 'size_units' => [ 'px', 'em', '%' ],
1787 'allowed_dimensions' => 'horizontal',
1788 'selectors' => [
1789 '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow.wdk-slider-prev' => 'margin-right:{{RIGHT}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};',
1790 ],
1791 ]
1792 );
1793
1794 $this->add_responsive_control(
1795 'styles_carousel_arrows_icon_left',
1796 [
1797 'label' => esc_html__('Icon', 'wpdirectorykit'),
1798 'type' => Controls_Manager::ICONS,
1799 'label_block' => true,
1800 'default' => [
1801 'value' => 'fa fa-angle-left',
1802 'library' => 'solid',
1803 ],
1804 ]
1805 );
1806
1807 $this->add_responsive_control(
1808 'styles_carousel_arrows_icon_right_h',
1809 [
1810 'label' => esc_html__('Arrow right', 'wpdirectorykit'),
1811 'type' => Controls_Manager::HEADING,
1812 'separator' => 'before',
1813 ]
1814 );
1815
1816 $this->add_responsive_control(
1817 'styles_carousel_arrows_s_m_right_margin',
1818 [
1819 'label' => esc_html__( 'Margin', 'wpdirectorykit' ),
1820 'type' => Controls_Manager::DIMENSIONS,
1821 'size_units' => [ 'px', 'em', '%' ],
1822 'allowed_dimensions' => 'horizontal',
1823 'selectors' => [
1824 '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow.wdk-slider-next' => 'margin-right:{{RIGHT}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};',
1825 ],
1826 ]
1827 );
1828
1829 $this->add_responsive_control(
1830 'styles_carousel_arrows_icon_right',
1831 [
1832 'label' => esc_html__('Icon', 'wpdirectorykit'),
1833 'type' => Controls_Manager::ICONS,
1834 'label_block' => true,
1835 'default' => [
1836 'value' => 'fa fa-angle-right',
1837 'library' => 'solid',
1838 ],
1839 ]
1840 );
1841
1842 $selectors = array(
1843 'normal' => '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow',
1844 'hover'=>'{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow%1$s'
1845 );
1846 $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_dynamic', ['margin','color','background','border','border_radius','padding','shadow','transition','font-size','hover_animation']);
1847
1848 $this->end_controls_section();
1849
1850 $this->start_controls_section(
1851 'styles_carousel_dots_section',
1852 [
1853 'label' => esc_html__('Section Dots', 'wpdirectorykit'),
1854 'tab' => Controls_Manager::TAB_STYLE,
1855 'conditions' => [
1856 'terms' => [
1857 [
1858 'name' => 'layout_type',
1859 'operator' => '==',
1860 'value' => 'carousel',
1861 ]
1862 ],
1863 ],
1864 ]
1865 );
1866
1867 $this->add_responsive_control(
1868 'styles_carousel_dots_hide',
1869 [
1870 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1871 'type' => Controls_Manager::SWITCHER,
1872 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1873 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1874 'return_value' => 'none',
1875 'default' => '',
1876 'selectors' => [
1877 '{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots' => 'display: {{VALUE}} !important;',
1878 ],
1879 ]
1880 );
1881
1882 $this->add_responsive_control(
1883 'styles_carousel_dots_position_style',
1884 [
1885 'label' => __( 'Position Style', 'wpdirectorykit' ),
1886 'type' => \Elementor\Controls_Manager::SELECT,
1887 'default' => 'wdk_slider_dots_out',
1888 'options' => [
1889 'wdk_slider_dots_out' => __( 'Out', 'wpdirectorykit' ),
1890 'wdk_slider_dots_in' => __( 'In', 'wpdirectorykit' ),
1891 ],
1892 ]
1893 );
1894
1895 $this->add_responsive_control(
1896 'styles_carousel_dots_align',
1897 [
1898 'label' => __( 'Position', 'wpdirectorykit' ),
1899 'type' => Controls_Manager::CHOOSE,
1900 'options' => [
1901 'left' => [
1902 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1903 'icon' => 'eicon-text-align-left',
1904 ],
1905 'center' => [
1906 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1907 'icon' => 'eicon-text-align-center',
1908 ],
1909 'right' => [
1910 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1911 'icon' => 'eicon-text-align-right',
1912 ],
1913 'justify' => [
1914 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
1915 'icon' => 'eicon-text-align-justify',
1916 ],
1917 ],
1918 'render_type' => 'ui',
1919 'selectors_dictionary' => [
1920 'left' => 'justify-content: flex-start;',
1921 'center' => 'justify-content: center;',
1922 'right' => 'justify-content: flex-end;',
1923 'justify' => 'justify-content: space-between;',
1924 ],
1925 'selectors' => [
1926 '{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots' => '{{VALUE}};',
1927 ],
1928 ]
1929 );
1930
1931 $this->add_responsive_control(
1932 'styles_carousel_dots_icon',
1933 [
1934 'label' => esc_html__('Icon', 'wpdirectorykit'),
1935 'type' => Controls_Manager::ICONS,
1936 'label_block' => true,
1937 'default' => [
1938 'value' => 'fas fa-circle',
1939 'library' => 'solid',
1940 ],
1941 ]
1942 );
1943
1944 $selectors = array(
1945 'normal' => '{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots li .wdk_lr_dot',
1946 'hover'=>'{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots li .wdk_lr_dot%1$s',
1947 'active'=>'{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots li.slick-active .wdk_lr_dot'
1948 );
1949
1950 $this->generate_renders_tabs($selectors, 'styles_carousel_dots_dynamic', ['margin','color','background','border','border_radius','padding','shadow','transition','font-size','hover_animation']);
1951
1952 $this->end_controls_section();
1953 }
1954
1955 private function generate_controls_content() {
1956
1957 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){
1958 $this->start_controls_section(
1959 'content_thumbnail_section',
1960 [
1961 'label' => esc_html__('Colors', 'wpdirectorykit'),
1962 'tab' => '1',
1963 'conditions' => [
1964 'terms' => [
1965 [
1966 'name' => 'is_custom_layout_enable',
1967 'operator' => '!=',
1968 'value' => 'yes',
1969 ]
1970 ],
1971 ],
1972 ]
1973 );
1974 } else {
1975 $this->start_controls_section(
1976 'content_thumbnail_section',
1977 [
1978 'label' => esc_html__('Colors', 'wpdirectorykit'),
1979 'tab' => '1',
1980 ]
1981 );
1982 }
1983
1984 $this->add_control(
1985 'content_thumbnail_section_header',
1986 [
1987 'label' => esc_html__('Color Hover Thumbnail', 'wpdirectorykit'),
1988 'type' => Controls_Manager::HEADING,
1989 ]
1990 );
1991
1992 $this->add_responsive_control(
1993 'content_thumbnail_section_d_background',
1994 [
1995 'label' => esc_html__( 'Color', 'wpdirectorykit' ),
1996 'description' => esc_html__( 'Set some opacity for color', 'wpdirectorykit' ),
1997 'type' => Controls_Manager::COLOR,
1998 'selectors' => [
1999 '{{WRAPPER}} .wdk-listing-card .wdk-thumbnail::before, {{WRAPPER}} .wdk-listing-card .wdk-thumbnail::after,{{WRAPPER}} .wdk-listing-card .overlay' => 'background-color: {{VALUE}};',
2000 ],
2001 ]
2002 );
2003
2004 $this->add_control(
2005 'content_thumbnail_section_header_f',
2006 [
2007 'label' => esc_html__('Shadow around Card, for Featured Listings', 'wpdirectorykit'),
2008 'type' => Controls_Manager::HEADING,
2009 ]
2010 );
2011
2012 $this->add_group_control(
2013 Group_Control_Box_Shadow::get_type(),
2014 [
2015 'name' => 'content_thumbnail_section_d_featured',
2016 'exclude' => [
2017 'field_shadow_position',
2018 ],
2019 'selector' => '{{WRAPPER}} .wdk-listing-card.is_featured',
2020 ]
2021 );
2022
2023 $this->end_controls_section();
2024
2025
2026 $items = [
2027 [
2028 'key'=>'content_card',
2029 'label'=> esc_html__('Card', 'wpdirectorykit'),
2030 'selector'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card',
2031 'options'=>'full',
2032 ],
2033 [
2034 'key'=>'content_label',
2035 'label'=> esc_html__('Over Image Top', 'wpdirectorykit'),
2036 'selector'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card .wdk-thumbnail .wdk-over-image-top span',
2037 'options'=>'full',
2038 ],
2039 [
2040 'key'=>'content_type',
2041 'label'=> esc_html__('Over Image Bottom', 'wpdirectorykit'),
2042 'selector'=>'.wdk-element .wdk-listing-card .wdk-thumbnail .wdk-over-image-bottom',
2043 'is_featured'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card.is_featured .wdk-thumbnail .wdk-over-image-bottom',
2044 'options'=>'full',
2045 ],
2046 [
2047 'key'=>'content_title',
2048 'label'=> esc_html__('Title Part', 'wpdirectorykit'),
2049 'selector'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card .wdk-title .title',
2050 'options'=>'full',
2051 ],
2052 [
2053 'key'=>'content_description',
2054 'label'=> esc_html__('Subtitle part', 'wpdirectorykit'),
2055 'selector'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card .wdk-subtitle-part',
2056 'options'=>'full',
2057 ],
2058 [
2059 'key'=>'content_items',
2060 'label'=> esc_html__('Features part', 'wpdirectorykit'),
2061 'selector'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card .wdk-features-part span',
2062 'options'=>'full',
2063 ],
2064 [
2065 'key'=>'wdk-divider',
2066 'label'=> esc_html__('Divider', 'wpdirectorykit'),
2067 'selector'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card .wdk-divider',
2068 'options'=>'full',
2069 ],
2070 [
2071 'key'=>'content_price',
2072 'label'=> esc_html__('Pricing part', 'wpdirectorykit'),
2073 'selector'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card .wdk-footer .wdk-price',
2074 'options'=>'full',
2075 ],
2076 [
2077 'key'=>'content_button',
2078 'label'=> esc_html__('Button Open', 'wpdirectorykit'),
2079 'selector'=>'.wdk-element .wdk-listings-results:not(.enable_separed_styles) .wdk-listing-card .wdk-footer .wdk-btn',
2080 'options'=>['margin','align','typo','color','background_group','border','border_radius','padding','shadow','transition'],
2081 ],
2082 ];
2083
2084
2085 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){
2086 $this->_generate_options_card($items,[
2087 'terms' => [
2088 [
2089 'name' => 'enable_separed_styles',
2090 'operator' => '!=',
2091 'value' => 'true',
2092 ], [
2093 'name' => 'is_custom_layout_enable',
2094 'operator' => '!=',
2095 'value' => 'yes',
2096 ]
2097 ],
2098 ]);
2099 } else {
2100 $this->_generate_options_card($items,[
2101 'terms' => [
2102 [
2103 'name' => 'enable_separed_styles',
2104 'operator' => '!=',
2105 'value' => 'true',
2106 ]
2107 ],
2108 ]);
2109 }
2110
2111
2112
2113
2114 $items = [
2115 [
2116 'key'=>'content_card_grid',
2117 'label'=> esc_html__('Card (Grid)', 'wpdirectorykit'),
2118 'selector'=>'.wdk-element .wdk-listing-card.grid',
2119 'options'=>'full',
2120 ],
2121 [
2122 'key'=>'content_label_grid',
2123 'label'=> esc_html__('Over Image Top (Grid)', 'wpdirectorykit'),
2124 'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-thumbnail .wdk-over-image-top span',
2125 'options'=>'full',
2126 ],
2127 [
2128 'key'=>'content_type_grid',
2129 'label'=> esc_html__('Over Image Bottom (Grid)', 'wpdirectorykit'),
2130 'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-thumbnail .wdk-over-image-bottom',
2131 'is_featured'=>'.wdk-element .wdk-listing-card.grid.is_featured .wdk-thumbnail .wdk-over-image-bottom',
2132 'options'=>'full',
2133 ],
2134 [
2135 'key'=>'content_title_grid',
2136 'label'=> esc_html__('Title Part (Grid)', 'wpdirectorykit'),
2137 'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-title .title',
2138 'options'=>'full',
2139 ],
2140 [
2141 'key'=>'content_description_grid',
2142 'label'=> esc_html__('Subtitle part (Grid)', 'wpdirectorykit'),
2143 'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-subtitle-part',
2144 'options'=>'full',
2145 ],
2146 [
2147 'key'=>'content_items_grid',
2148 'label'=> esc_html__('Features part (Grid)', 'wpdirectorykit'),
2149 'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-features-part span',
2150 'options'=>'full',
2151 ],
2152 [
2153 'key'=>'wdk-divider_grid',
2154 'label'=> esc_html__('Divider (Grid)', 'wpdirectorykit'),
2155 'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-divider',
2156 'options'=>'full',
2157 ],
2158 [
2159 'key'=>'content_price_grid',
2160 'label'=> esc_html__('Pricing part (Grid)', 'wpdirectorykit'),
2161 'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-footer .wdk-price',
2162 'options'=>'full',
2163 ],
2164 [
2165 'key'=>'content_button_grid',
2166 'label'=> esc_html__('Button Open (Grid)', 'wpdirectorykit'),
2167 'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-footer .wdk-btn',
2168 'options'=>['margin','align','typo','color','background_group','border','border_radius','padding','shadow','transition'],
2169 ],
2170 ];
2171
2172 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){
2173
2174 $this->_generate_options_card($items,[
2175 'terms' => [
2176 [
2177 'name' => 'enable_separed_styles',
2178 'operator' => '==',
2179 'value' => 'true',
2180 ], [
2181 'name' => 'is_custom_layout_enable',
2182 'operator' => '!=',
2183 'value' => 'yes',
2184 ]
2185 ],
2186 ],'.grid');
2187 } else {
2188
2189 $this->_generate_options_card($items,[
2190 'terms' => [
2191 [
2192 'name' => 'enable_separed_styles',
2193 'operator' => '==',
2194 'value' => 'true',
2195 ]
2196 ],
2197 ],'.grid');
2198 }
2199
2200 $items = [
2201 [
2202 'key'=>'content_card_list',
2203 'label'=> esc_html__('Card (List)', 'wpdirectorykit'),
2204 'selector'=>'.wdk-element .wdk-listing-card.list',
2205 'options'=>'full',
2206 ],
2207 [
2208 'key'=>'content_label_list',
2209 'label'=> esc_html__('Over Image Top (List)', 'wpdirectorykit'),
2210 'selector'=>'.wdk-element .wdk-listing-card.list .wdk-thumbnail .wdk-over-image-top span',
2211 'options'=>'full',
2212 ],
2213 [
2214 'key'=>'content_type_list',
2215 'label'=> esc_html__('Over Image Bottom (List)', 'wpdirectorykit'),
2216 'selector'=>'.wdk-element .wdk-listing-card.list .wdk-thumbnail .wdk-over-image-bottom',
2217 'is_featured'=>'.wdk-element .wdk-listing-card.list.is_featured .wdk-thumbnail .wdk-over-image-bottom',
2218 'options'=>'full',
2219 ],
2220 [
2221 'key'=>'content_title_list',
2222 'label'=> esc_html__('Title Part (List)', 'wpdirectorykit'),
2223 'selector'=>'.wdk-element .wdk-listing-card.list .wdk-title .title',
2224 'options'=>'full',
2225 ],
2226 [
2227 'key'=>'content_description_list',
2228 'label'=> esc_html__('Subtitle part (List)', 'wpdirectorykit'),
2229 'selector'=>'.wdk-element .wdk-listing-card.list .wdk-subtitle-part',
2230 'options'=>'full',
2231 ],
2232 [
2233 'key'=>'content_items_list',
2234 'label'=> esc_html__('Features part (List)', 'wpdirectorykit'),
2235 'selector'=>'.wdk-element .wdk-listing-card.list .wdk-features-part span',
2236 'options'=>'full',
2237 ],
2238 [
2239 'key'=>'wdk-divider_list',
2240 'label'=> esc_html__('Divider (List)', 'wpdirectorykit'),
2241 'selector'=>'.wdk-element .wdk-listing-card.list .wdk-divider',
2242 'options'=>'full',
2243 ],
2244 [
2245 'key'=>'content_price_list',
2246 'label'=> esc_html__('Pricing part (List)', 'wpdirectorykit'),
2247 'selector'=>'.wdk-element .wdk-listing-card.list .wdk-footer .wdk-price',
2248 'options'=>'full',
2249 ],
2250 [
2251 'key'=>'content_button_list',
2252 'label'=> esc_html__('Button Open (List)', 'wpdirectorykit'),
2253 'selector'=>'.wdk-element .wdk-listing-card.list .wdk-footer .wdk-btn',
2254 'options'=>['margin','align','typo','color','background_group','border','border_radius','padding','shadow','transition'],
2255 ],
2256 ];
2257
2258 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){
2259 $this->_generate_options_card($items,[
2260 'terms' => [
2261 [
2262 'name' => 'enable_separed_styles',
2263 'operator' => '==',
2264 'value' => 'true',
2265 ], [
2266 'name' => 'is_custom_layout_enable',
2267 'operator' => '!=',
2268 'value' => 'yes',
2269 ]
2270 ],
2271 ],'.list');
2272 } else {
2273 $this->_generate_options_card($items,[
2274 'terms' => [
2275 [
2276 'name' => 'enable_separed_styles',
2277 'operator' => '==',
2278 'value' => 'true',
2279 ]
2280 ],
2281 ],'.list');
2282 }
2283
2284
2285
2286 $this->start_controls_section(
2287 'pagination_styles',
2288 [
2289 'label' => esc_html__('Pagination Section', 'wpdirectorykit'),
2290 'tab' => '1',
2291 ]
2292 );
2293 $this->add_responsive_control(
2294 'pagination_styles_align',
2295 [
2296 'label' => __( 'Align', 'wpdirectorykit' ),
2297 'type' => Controls_Manager::CHOOSE,
2298 'options' => [
2299 'left' => [
2300 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
2301 'icon' => 'eicon-text-align-left',
2302 ],
2303 'center' => [
2304 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
2305 'icon' => 'eicon-text-align-center',
2306 ],
2307 'right' => [
2308 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
2309 'icon' => 'eicon-text-align-right',
2310 ],
2311 ],
2312 'render_type' => 'ui',
2313 'selectors_dictionary' => [
2314 'left' => 'justify-content: flex-start;',
2315 'center' => 'justify-content: center;',
2316 'right' => 'justify-content: flex-end;',
2317 ],
2318 'selectors' => [
2319 '{{WRAPPER}} .wdk-pagination.pagination' => '{{VALUE}};',
2320 ],
2321 ]
2322 );
2323
2324 $selectors = array(
2325 'normal' => '{{WRAPPER}} .wdk-pagination.pagination',
2326 );
2327
2328 $this->generate_renders_tabs($selectors, 'pagination_styles_dynamic', 'block', ['align']);
2329
2330 $this->add_control(
2331 'pagination_styles_head',
2332 [
2333 'label' => esc_html__('Pagination Links', 'wpdirectorykit'),
2334 'type' => Controls_Manager::HEADING,
2335 'separator' => 'before',
2336 ]
2337 );
2338
2339 $selectors = array(
2340 'normal' => '{{WRAPPER}} .wdk-pagination.pagination .nav-links > *',
2341 'hover'=>'{{WRAPPER}} .wdk-pagination.pagination .nav-links > *%1$s',
2342 'active'=>'{{WRAPPER}} .wdk-pagination.pagination .nav-links > *.current'
2343 );
2344 $this->generate_renders_tabs($selectors, 'pagination_styles_items_dynamic', ['margin','typo','color','background','border','border_radius','padding','shadow','transition', 'width','height']);
2345
2346 $this->end_controls_section();
2347
2348 $items = [
2349 /* header filter */
2350 [
2351 'key'=>'filter_section_box',
2352 'label'=> esc_html__('Filter Box', 'wpdirectorykit'),
2353 'selector'=>'.wdk-filter-head',
2354 'options'=> ['margin','background','border','border_radius','padding','shadow'],
2355 ],
2356 [
2357 'key'=>'filter_group_box',
2358 'label'=> esc_html__('Group Box', 'wpdirectorykit'),
2359 'selector'=>'.wdk-filter-head .filter-group',
2360 'options'=>['margin','background','border','border_radius','padding','shadow'],
2361 ],
2362 [
2363 'key'=>'filter_group_box_order_select',
2364 'label'=> esc_html__('Select Order', 'wpdirectorykit'),
2365 'selector'=>'.wdk-filter-head .filter-group .wdk-order',
2366 'options'=>'full',
2367 ],
2368 [
2369 'key'=>'filter_group_box_order',
2370 'label'=> esc_html__('Group Box View Type', 'wpdirectorykit'),
2371 'selector'=>'.wdk-filter-head .filter-group.wmvc-view-type',
2372 'options'=>false,
2373 ],
2374 [
2375 'key'=>'filter_group_box_view',
2376 'label'=> esc_html__('View Type Icons', 'wpdirectorykit'),
2377 'selector'=>'.wdk-filter-head .filter-group.wmvc-view-type a',
2378 'hover_enable' => true,
2379 'options'=>['align','font-size','color','background','border','border_radius','padding','shadow','transition','margin','width','height'],
2380 ],
2381 [
2382 'key'=>'filter_group_box_filter-status',
2383 'label'=> esc_html__('Listings Count', 'wpdirectorykit'),
2384 'selector'=>'.wdk-filter-head .filter-group.filter-status',
2385 'options'=>'text',
2386 ],
2387 ];
2388
2389 $this->start_controls_section(
2390 'filter_section',
2391 [
2392 'label' => esc_html__( 'Filter Header', 'wpdirectorykit' ),
2393 'tab' => '1',
2394 'conditions' => [
2395 'terms' => [
2396 [
2397 'name' => 'get_filters_enable',
2398 'operator' => '==',
2399 'value' => 'yes',
2400 ]
2401 ],
2402 ],
2403 ]
2404 );
2405 foreach ($items as $item) {
2406 $this->add_control(
2407 $item['key'].'_head',
2408 [
2409 'label' => $item['label'],
2410 'type' => Controls_Manager::HEADING,
2411 'separator' => 'before',
2412 ]
2413 );
2414
2415 $this->add_responsive_control(
2416 $item['key'].'_hide',
2417 [
2418 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
2419 'type' => Controls_Manager::SWITCHER,
2420 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
2421 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
2422 'return_value' => 'none',
2423 'default' => '',
2424 'selectors' => [
2425 '{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};',
2426 ],
2427 ]
2428 );
2429
2430 if($item['options']){
2431 $selectors = array(
2432 'normal' => '{{WRAPPER}} '.$item['selector']
2433 );
2434 if(isset($item['hover_enable']) && $item['hover_enable'])
2435 $selectors['hover'] = '{{WRAPPER}} '.$item['selector'].'%1$s';
2436
2437
2438 if( $item['key'] == 'filter_group_box_view')
2439 $selectors['active'] = '{{WRAPPER}} '.$item['selector'].'.active';
2440
2441 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
2442 }
2443 /* special for some elements */
2444 if($item['key'] == 'filter_group_box_order') {
2445 $this->add_responsive_control(
2446 $item['key'].'_align',
2447 [
2448 'label' => __( 'Position', 'wpdirectorykit' ),
2449 'type' => Controls_Manager::CHOOSE,
2450 'options' => [
2451 'left' => [
2452 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
2453 'icon' => 'eicon-text-align-left',
2454 ],
2455 'center' => [
2456 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
2457 'icon' => 'eicon-text-align-center',
2458 ],
2459 'right' => [
2460 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
2461 'icon' => 'eicon-text-align-right',
2462 ],
2463 'justify' => [
2464 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
2465 'icon' => 'eicon-text-align-justify',
2466 ],
2467 ],
2468 'render_type' => 'ui',
2469 'selectors_dictionary' => [
2470 'left' => 'justify-content: flex-start;',
2471 'center' => 'justify-content: center;',
2472 'right' => 'justify-content: flex-end;',
2473 'justify' => 'justify-content: space-between;',
2474 ],
2475 'selectors' => [
2476 '{{WRAPPER}} '.$item['selector'] => '{{VALUE}};',
2477 ],
2478 ]
2479 );
2480 }
2481 if($item['key'] == 'filter_group_box') {
2482 $this->add_control(
2483 $item['key'].'_icon',
2484 [
2485 'label' => esc_html__('Icon Order', 'wpdirectorykit'),
2486 'type' => Controls_Manager::ICONS,
2487 'label_block' => true,
2488 'default' => [
2489 'value' => 'fa fa-filter',
2490 'library' => 'solid',
2491 ],
2492 ]
2493 );
2494 $selectors = array(
2495 'normal' => '{{WRAPPER}} '.$item['selector'].' i',
2496 );
2497 $this->generate_renders_tabs($selectors, $item['key'].'_icon_dynamic', ['margin']);
2498 }
2499 /* END special for some elements */
2500 }
2501 $this->end_controls_section();
2502 }
2503
2504 private function _generate_options_card($items, $conditions = NULL, $prefix = ''){
2505
2506 foreach ($items as $item) {
2507 $this->start_controls_section(
2508 $item['key'].'_section',
2509 [
2510 'label' => $item['label'],
2511 'tab' => '1',
2512 'conditions' => $conditions
2513 ]
2514 );
2515 $this->add_responsive_control(
2516 $item['key'].'_hide',
2517 [
2518 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
2519 'type' => Controls_Manager::SWITCHER,
2520 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
2521 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
2522 'return_value' => 'none',
2523 'default' => '',
2524 'selectors' => [
2525 '{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};',
2526 ],
2527 ]
2528 );
2529
2530 $this->add_responsive_control(
2531 $item['key'].'_min-height',
2532 [
2533 'label' => esc_html__('Min Height', 'wpdirectorykit'),
2534 'type' => Controls_Manager::SLIDER,
2535 'range' => [
2536 'px' => [
2537 'min' => 10,
2538 'max' => 1500,
2539 ],
2540 'vw' => [
2541 'min' => 0,
2542 'max' => 100,
2543 ],
2544 '%' => [
2545 'min' => 0,
2546 'max' => 100,
2547 ],
2548 ],
2549 'size_units' => [ 'px', 'vw','%' ],
2550 'selectors' => [
2551 '{{WRAPPER}} '.$item['selector'] => 'min-height: {{SIZE}}{{UNIT}}',
2552 ],
2553
2554 ]
2555 );
2556
2557
2558 $selectors = array(
2559 'normal' => '{{WRAPPER}} '.$item['selector'],
2560 'hover'=>'{{WRAPPER}} '.$item['selector'].'%1$s'
2561 );
2562
2563 if(isset($item['is_featured'])) {
2564 $selectors['featured'] = '{{WRAPPER}} '.$item['is_featured'];
2565 }
2566
2567 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
2568
2569 /* special for some elements */
2570 if (strpos($item['key'], 'content_description') !== FALSE ) {
2571
2572 $key_option = $item['key'].'content_description_limit';
2573 if($item['key'] == 'content_description_limit') {
2574 $key_option = 'content_description_limit';
2575 }
2576
2577 $this->add_control(
2578 $key_option,
2579 [
2580 'label' => __( 'Limit Line (per field)', 'wpdirectorykit' ),
2581 'type' => \Elementor\Controls_Manager::NUMBER,
2582 'min' => 1,
2583 'max' => 10,
2584 'step' => 1,
2585 'default' => 3,
2586 'selectors' => [
2587 '{{WRAPPER}} .wdk-listing-card'.$prefix.' .wdk-subtitle-part span' => '-webkit-line-clamp: {{VALUE}};',
2588 ],
2589 ]
2590 );
2591 }
2592
2593 if(strpos($item['key'], 'content_button') !== FALSE) {
2594
2595 if($item['key'] == 'content_button') {
2596 $this->add_control(
2597 $item['key'].'_icon',
2598 [
2599 'label' => esc_html__('Icon', 'wpdirectorykit'),
2600 'type' => Controls_Manager::ICONS,
2601 'label_block' => true,
2602 'default' => [
2603 'value' => 'fa fa-angle-right',
2604 'library' => 'solid',
2605 ],
2606 ]
2607 );
2608 }
2609
2610 $selectors = array(
2611 'normal' => '{{WRAPPER}} '.$item['selector'].' i',
2612 );
2613 $this->generate_renders_tabs($selectors, $item['key'].'_icon_dynamic', ['margin']);
2614 }
2615
2616 if(strpos($item['key'], 'content_label') !== FALSE) {
2617 $this->add_control(
2618 $item['key'].'_parent_head',
2619 [
2620 'label' => esc_html__('Parent Box', 'wpdirectorykit'),
2621 'type' => Controls_Manager::HEADING,
2622 'separator' => 'before',
2623 ]
2624 );
2625
2626 $selectors = array(
2627 'normal' => '{{WRAPPER}} .wdk-element .wdk-listing-card'.$prefix.' .wdk-over-image-top',
2628 );
2629 $this->generate_renders_tabs($selectors, $item['key'].'_parent_dynamic', ['margin']);
2630 }
2631
2632 if(strpos($item['key'], 'content_items') !== FALSE) {
2633 $this->add_control(
2634 $item['key'].'_parent_head',
2635 [
2636 'label' => esc_html__('Parent Box', 'wpdirectorykit'),
2637 'type' => Controls_Manager::HEADING,
2638 'separator' => 'before',
2639 ]
2640 );
2641
2642 $selectors = array(
2643 'normal' => '{{WRAPPER}} .wdk-element .wdk-listing-card'.$prefix.' .wdk-features-part',
2644 );
2645 $this->generate_renders_tabs($selectors, $item['key'].'_parent_dynamic', ['margin','align']);
2646 }
2647
2648 if(strpos($item['key'], 'content_label') !== FALSE) {
2649 $this->add_responsive_control(
2650 $item['key'] .'content_label_positions_y',
2651 [
2652 'label' => __( 'Position Y', 'wpdirectorykit' ),
2653 'type' => Controls_Manager::CHOOSE,
2654 'options' => [
2655 'top' => [
2656 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
2657 'icon' => 'eicon-text-align-top',
2658 ],
2659 'center' => [
2660 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
2661 'icon' => 'eicon-text-align-center',
2662 ],
2663 'bottom' => [
2664 'title' => esc_html__( 'Bottom', 'wpdirectorykit' ),
2665 'icon' => 'eicon-text-align-bottom',
2666 ],
2667 ],
2668 'default' => 'left',
2669 'render_type' => 'ui',
2670 'selectors_dictionary' => [
2671 'top' => 'top:0;bottom:initial',
2672 'center' => 'top:50%;transform: translateY(-50%)',
2673 'bottom' => 'top:initial;bottom:0',
2674 ],
2675 'selectors' => [
2676 '{{WRAPPER}} .wdk-listing-card'.$prefix.' .wdk-thumbnail .wdk-over-image-top' => '{{VALUE}};',
2677 ],
2678 ]
2679 );
2680
2681 $this->add_responsive_control(
2682 $item['key'] .'content_label_positions_x',
2683 [
2684 'label' => __( 'Position X', 'wpdirectorykit' ),
2685 'type' => Controls_Manager::CHOOSE,
2686 'options' => [
2687 'left' => [
2688 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
2689 'icon' => 'eicon-text-align-left',
2690 ],
2691 'center' => [
2692 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
2693 'icon' => 'eicon-text-align-center',
2694 ],
2695 'right' => [
2696 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
2697 'icon' => 'eicon-text-align-right',
2698 ],
2699 ],
2700 'default' => 'left',
2701 'render_type' => 'ui',
2702 'selectors_dictionary' => [
2703 'left' => 'left:0',
2704 'center' => 'left:50%;transform: translateX(-50%)',
2705 'right' => 'left:initial; right:0',
2706 ],
2707 'selectors' => [
2708 '{{WRAPPER}} .wdk-listing-card'.$prefix.' .wdk-thumbnail .wdk-over-image-top' => '{{VALUE}};',
2709 ],
2710 ]
2711 );
2712 }
2713
2714 if(strpos($item['key'], 'content_type') !== FALSE) {
2715 $this->add_responsive_control(
2716 $item['key'] .'content_label_positions_y',
2717 [
2718 'label' => __( 'Position Y', 'wpdirectorykit' ),
2719 'type' => Controls_Manager::CHOOSE,
2720 'options' => [
2721 'top' => [
2722 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
2723 'icon' => 'eicon-text-align-top',
2724 ],
2725 'center' => [
2726 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
2727 'icon' => 'eicon-text-align-center',
2728 ],
2729 'bottom' => [
2730 'title' => esc_html__( 'Bottom', 'wpdirectorykit' ),
2731 'icon' => 'eicon-text-align-bottom',
2732 ],
2733 ],
2734 'default' => 'left',
2735 'render_type' => 'ui',
2736 'selectors_dictionary' => [
2737 'top' => 'top:0;bottom:initial',
2738 'center' => 'top:50%;transform: translateY(-50%)',
2739 'bottom' => 'top:initial;bottom:0',
2740 ],
2741 'selectors' => [
2742 '{{WRAPPER}} '.$item['selector'] => '{{VALUE}};',
2743 ],
2744 ]
2745 );
2746
2747 $this->add_responsive_control(
2748 $item['key'] .'content_label_positions_x',
2749 [
2750 'label' => __( 'Position X', 'wpdirectorykit' ),
2751 'type' => Controls_Manager::CHOOSE,
2752 'options' => [
2753 'left' => [
2754 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
2755 'icon' => 'eicon-text-align-left',
2756 ],
2757 'center' => [
2758 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
2759 'icon' => 'eicon-text-align-center',
2760 ],
2761 'right' => [
2762 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
2763 'icon' => 'eicon-text-align-right',
2764 ],
2765 'justify' => [
2766 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
2767 'icon' => 'eicon-text-align-justify',
2768 ],
2769 ],
2770 'default' => 'left',
2771 'render_type' => 'ui',
2772 'selectors_dictionary' => [
2773 'top' => 'justify-content: flex-start;',
2774 'center' => 'justify-content: center;',
2775 'bottom' => 'justify-content: flex-end;',
2776 'justify' => 'justify-content: stretch;',
2777 ],
2778 'selectors' => [
2779 '{{WRAPPER}} '.$item['selector'] => '{{VALUE}};',
2780 ],
2781 ]
2782 );
2783 }
2784 $this->end_controls_section();
2785 }
2786
2787 }
2788
2789 public function enqueue_styles_scripts() {
2790 wp_enqueue_style('slick');
2791 wp_enqueue_style('slick-theme');
2792 wp_enqueue_script('slick');
2793
2794 wp_enqueue_style('wdk-notify');
2795 wp_enqueue_script('wdk-notify');
2796
2797 if( wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')) {
2798 wp_enqueue_script( 'wdk-ajax-loading-listings');
2799 }
2800 }
2801 }
2802