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

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

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