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-listings-results.php

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

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