PluginProbe
WP Directory Kit / 1.2.6
WP Directory Kit v1.2.6
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.2.6, at elementor-elements/classes/wdk-listing-agents-listings.php

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