PluginProbe
WP Directory Kit / 1.3.3
WP Directory Kit v1.3.3
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.3, at elementor-elements/classes/wdk-listings-results.php

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