PluginProbe
WP Directory Kit / 1.2.7
WP Directory Kit v1.2.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 1.4.0 1.4.1 All 35 releases
wpdirectorykit / elementor-elements / classes / wdk-locations-grid-cover.php

wdk-locations-grid-cover.php in WP Directory Kit 1.2.7, at elementor-elements/classes/wdk-locations-grid-cover.php

782 lines 29.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 use Elementor\Group_Control_Css_Filter;
19
20 if (!defined('ABSPATH'))
21 exit; // Exit if accessed directly
22
23 /**
24 * @since 1.1.0
25 */
26 class WdkLocationsGridCover 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
46 if ($this->is_edit_mode_load()) {
47 $this->enqueue_styles_scripts();
48 }
49
50 parent::__construct($data, $args);
51 }
52
53 /**
54 * Retrieve the widget name.
55 *
56 * @since 1.1.0
57 *
58 * @access public
59 *
60 * @return string Widget name.
61 */
62 public function get_name() {
63 return 'wdk-locations-grid-cover';
64 }
65
66 /**
67 * Retrieve the widget title.
68 *
69 * @since 1.1.0
70 *
71 * @access public
72 *
73 * @return string Widget title.
74 */
75 public function get_title() {
76 return esc_html__('Wdk Locations Grid Cover', 'wpdirectorykit');
77 }
78
79 /**
80 * Retrieve the widget icon.
81 *
82 * @since 1.1.0
83 *
84 * @access public
85 *
86 * @return string Widget icon.
87 */
88 public function get_icon() {
89 return 'eicon-featured-image';
90 }
91
92 /**
93 * Register the widget controls.
94 *
95 * Adds different input fields to allow the user to change and customize the widget settings.
96 *
97 * @since 1.1.0
98 *
99 * @access protected
100 */
101 protected function register_controls() {
102 $this->generate_controls_conf();
103 $this->generate_controls_layout();
104 $this->generate_controls_styles();
105 $this->generate_controls_content();
106
107 $this->insert_pro_message('1');
108 parent::register_controls();
109 }
110
111 /**
112 * Render the widget output on the frontend.
113 *
114 * Written in PHP and used to generate the final HTML.
115 *
116 * @since 1.1.0
117 *
118 * @access protected
119 */
120 protected function render() {
121 parent::render();
122 $this->data['id_element'] = $this->get_id();
123 $this->data['settings'] = $this->get_settings();
124
125 $controller = 'location';
126 $this->WMVC->model($controller.'_m');
127
128 $this->data['results'] = array();
129
130 $controller = 'location';
131 $this->WMVC->model($controller.'_m');
132 $this->WMVC->model('listing_m');
133
134 $this->data['results'] = false;
135
136 if($this->data['settings']['conf_results_type'] == 'custom_locations') {
137
138 $locations_ids = array();
139 foreach($this->data['settings']['conf_custom_results'] as $location) {
140 if(isset($location['location_id']) && !empty($location['location_id'])) {
141 $locations_ids [] = $location['location_id'];
142 }
143 }
144
145 /* where in */
146 if(!empty($locations_ids)){
147
148 $this->WMVC->db->select($this->WMVC->{$controller.'_m'}->_table_name.'.*, COUNT('.$this->WMVC->listing_m->_table_name.'.post_id) AS listings_counter');
149 $this->WMVC->db->join($this->WMVC->listing_m->_table_name.' ON '.$this->WMVC->listing_m->_table_name.'.location_id = '.$this->WMVC->{$controller.'_m'}->_table_name.'.idlocation', TRUE, 'LEFT');
150 $this->WMVC->db->where($this->WMVC->{$controller.'_m'}->_table_name.'.idlocation IN(' . implode(',', $locations_ids) . ')', null, false);
151 $this->WMVC->db->order_by('FIELD('.$this->WMVC->{$controller.'_m'}->_table_name.'.idlocation, '. implode(',', $locations_ids) . ')');
152 $this->WMVC->db->group_by($this->WMVC->{$controller.'_m'}->_primary_key);
153
154 $this->data['results'] = $this->WMVC->{$controller.'_m'}->get();
155 }
156
157 } else {
158 $order_by = NULL;
159 /* deprecated, added column listings_counter for this */
160 if($this->data['settings']['conf_order_by'] == 'order_most') {
161 /* get location with most listings */
162 global $wpdb;
163 $order_by = 'listings_counter '.$this->data['settings']['conf_order'];
164 $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination($this->data['settings']['conf_limit'], null, array(), $order_by);
165 } else {
166 $where = array();
167 if (!empty($this->data['settings']['conf_order_by'])) {
168 $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
169 }
170
171 if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
172 $where['('.$this->WMVC->{$controller.'_m'}->_table_name.'.level = 0)'] = NULL;
173 }
174
175 $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination($this->data['settings']['conf_limit'], null, $where, $order_by);
176
177
178 }
179 }
180
181 $this->data['is_edit_mode']= false;
182 if(Plugin::$instance->editor->is_edit_mode())
183 $this->data['is_edit_mode']= true;
184
185 echo $this->view('wdk-locations-grid-cover', $this->data);
186 }
187
188
189 private function generate_controls_conf() {
190 $this->start_controls_section(
191 'tab_conf_main_section',
192 [
193 'label' => esc_html__('Main', 'wpdirectorykit'),
194 'tab' => '1',
195 ]
196 );
197
198 $pages = array('' => __('Not Selected', 'wpdirectorykit'));
199 foreach(get_pages(array('sort_column' => 'post_title')) as $page)
200 {
201 $pages[$page->ID] = $page->post_title.' #'.$page->ID;
202 }
203
204 $this->add_control(
205 'conf_link',
206 [
207 'label' => __( 'Open results on page', 'wpdirectorykit' ),
208 'type' => \Elementor\Controls_Manager::SELECT,
209 'default' => '',
210 'options' => $pages
211 ]
212 );
213
214 $this->add_control(
215 'conf_results_type',
216 [
217 'label' => __( 'Show type', 'wpdirectorykit' ),
218 'type' => \Elementor\Controls_Manager::SELECT,
219 'default' => 'results_locations',
220 'options' => [
221 'results_locations' => __( 'All Locations', 'wpdirectorykit' ),
222 'custom_locations' => __( 'Specific', 'wpdirectorykit' ),
223 ],
224 'separator' => 'after',
225 ]
226 );
227
228 $this->add_control(
229 'important_note',
230 [
231 'label' => '',
232 'type' => \Elementor\Controls_Manager::RAW_HTML,
233 'raw' => wdk_sprintf(__( 'Edit Locations <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_location')),
234 'content_classes' => 'wdk_elementor_hint',
235 ]
236 );
237
238 $this->add_responsive_control(
239 'only_root_enable',
240 [
241 'label' => esc_html__( 'Show only Root', 'wpdirectorykit' ),
242 'type' => Controls_Manager::SWITCHER,
243 'none' => esc_html__( 'No', 'wpdirectorykit' ),
244 'block' => esc_html__( 'Yes', 'wpdirectorykit' ),
245 'return_value' => 'yes',
246 'default' => 'yes',
247 ]
248 );
249
250 $this->add_control(
251 'conf_limit',
252 [
253 'label' => __( 'Limit Locations', 'wpdirectorykit' ),
254 'type' => \Elementor\Controls_Manager::NUMBER,
255 'min' => 1,
256 'max' => 50,
257 'step' => 1,
258 'default' => 3,
259 'separator' => 'before',
260 'conditions' => [
261 'terms' => [
262 [
263 'name' => 'conf_results_type',
264 'operator' => '==',
265 'value' => 'results_locations',
266 ]
267 ],
268 ],
269 ]
270 );
271
272 $this->add_control(
273 'conf_order_by',
274 [
275 'label' => __('Order By Column', 'wpdirectorykit'),
276 'type' => Controls_Manager::SELECT,
277 'label_block' => true,
278 'options' => [
279 '' => __('None', 'wpdirectorykit'),
280 'location_title' => __('Title', 'wpdirectorykit'),
281 'idlocation' => __('Location id', 'wpdirectorykit'),
282 'order_index' => __('Order index', 'wpdirectorykit'),
283 'listings_counter' => __('Most Listings', 'wpdirectorykit'),
284 ],
285 'default' => 'order_index',
286 'conditions' => [
287 'terms' => [
288 [
289 'name' => 'conf_results_type',
290 'operator' => '==',
291 'value' => 'results_locations',
292 ]
293 ],
294 ],
295 ]
296 );
297
298 $this->add_control(
299 'conf_order',
300 [
301 'label' => __('Order', 'wpdirectorykit'),
302 'type' => Controls_Manager::SELECT,
303 'label_block' => true,
304 'options' => [
305 'asc' => __('Ascending', 'wpdirectorykit'),
306 'desc' => __('Descending', 'wpdirectorykit')
307 ],
308 'default' => 'desc',
309 'conditions' => [
310 'terms' => [
311 [
312 'name' => 'conf_results_type',
313 'operator' => '==',
314 'value' => 'results_locations',
315 ]
316 ],
317 ],
318 ]
319 );
320
321 if(true){
322 $repeater = new Repeater();
323 $repeater->start_controls_tabs( 'locations' );
324 $repeater->add_control(
325 'location_id',
326 [
327 'label' => __( 'ID location', 'wpdirectorykit' ),
328 'type' => \Elementor\Controls_Manager::NUMBER,
329 'min' => 1,
330 'step' => 1,
331 ]
332 );
333 $repeater->end_controls_tabs();
334
335
336 $this->add_control(
337 'conf_custom_results',
338 [
339 'type' => Controls_Manager::REPEATER,
340 'fields' => $repeater->get_controls(),
341 'default' => [
342 ],
343 'title_field' => '{{{ location_id }}}',
344 'conditions' => [
345 'terms' => [
346 [
347 'name' => 'conf_results_type',
348 'operator' => '==',
349 'value' => 'custom_locations',
350 ]
351 ],
352 ],
353 ]
354 );
355 }
356
357 $this->end_controls_section();
358
359 }
360
361 private function generate_controls_layout() {
362 }
363
364 private function generate_controls_styles() {
365 $this->start_controls_section(
366 'styles_thmbn_section',
367 [
368 'label' => esc_html__('Main', 'wpdirectorykit'),
369 'tab' => Controls_Manager::TAB_STYLE,
370 ]
371 );
372
373 $this->add_responsive_control(
374 'row_gap_col',
375 [
376 'label' => __( 'Columns', 'wpdirectorykit' ),
377 'type' => Controls_Manager::SELECT,
378 'options' => [
379 '' => esc_html__('Default', 'wpdirectorykit'),
380 'auto' => esc_html__('Auto', 'wpdirectorykit'),
381 '100%' => '1',
382 '50%' => '2',
383 'calc(100% / 3)' => '3',
384 '25%' => '4',
385 '20%' => '5',
386 'auto_flexible' => 'auto flexible',
387 ],
388 'selectors_dictionary' => [
389 'auto' => '-webkit-flex:1 2 auto;flex:1 2 auto',
390 '100%' => '-webkit-flex:1 2 100%;flex:1 2 100%',
391 '50%' => '-webkit-flex:1 2 50%;flex:1 2 50%',
392 'calc(100% / 3)' => '-webkit-flex:1 2 calc(100% / 3);flex:1 2 calc(100% / 3)',
393 '25%' => '-webkit-flex:1 2 25%;flex:1 2 25%',
394 '20%' => '-webkit-flex:1 2 20%;flex:1 2 20%',
395 'auto' => '-webkit-flex:1 2 auto;flex:1 2 auto',
396 'auto_flexible' => '-webkit-flex:1 2 auto;flex:1 2 auto',
397 ],
398 'selectors' => [
399 '{{WRAPPER}} .wdk-row .wdk-col' => '{{UNIT}}',
400 ],
401 'default' => 'calc(100% / 3)',
402 'separator' => 'before',
403 ]
404 );
405
406 $this->add_responsive_control(
407 'column_gap',
408 [
409 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
410 'type' => Controls_Manager::SLIDER,
411 'default' => [
412 'size' => 10,
413 ],
414 'range' => [
415 'px' => [
416 'min' => 0,
417 'max' => 60,
418 ],
419 ],
420 'selectors' => [
421 '{{WRAPPER}} .wdk-row .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
422 '{{WRAPPER}} .wdk-row' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
423 ],
424 ]
425 );
426
427 $this->add_responsive_control(
428 'row_gap',
429 [
430 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
431 'type' => Controls_Manager::SLIDER,
432 'default' => [
433 'size' => 10,
434 ],
435 'range' => [
436 'px' => [
437 'min' => 0,
438 'max' => 60,
439 ],
440 ],
441 'selectors' => [
442 '{{WRAPPER}} .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};',
443 '{{WRAPPER}} .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
444 ],
445 ]
446 );
447
448 $this->end_controls_section();
449
450 $this->start_controls_section(
451 'content_thumbnail_section',
452 [
453 'label' => esc_html__('Colors', 'wpdirectorykit'),
454 'tab' => Controls_Manager::TAB_STYLE,
455 ]
456 );
457
458 $this->add_control(
459 'content_thumbnail_section_header',
460 [
461 'label' => esc_html__('Color Hover Thumbnail', 'wpdirectorykit'),
462 'type' => Controls_Manager::HEADING,
463 ]
464 );
465
466 $this->add_responsive_control(
467 'content_thumbnail_section_d_background',
468 [
469 'label' => esc_html__( 'Color', 'wpdirectorykit' ),
470 'description' => esc_html__( 'Set some opacity for color', 'wpdirectorykit' ),
471 'type' => Controls_Manager::COLOR,
472 'selectors' => [
473 '{{WRAPPER}} .wdk-locations-card-cover::before, {{WRAPPER}} .wdk-locations-card-cover::after,{{WRAPPER}} .wdk-locations-card-cover .overlay' => 'background-color: {{VALUE}};',
474 ],
475 ]
476 );
477
478 $this->end_controls_section();
479
480 $this->start_controls_section(
481 'styles_card',
482 [
483 'label' => esc_html__('Card', 'wpdirectorykit'),
484 'tab' => Controls_Manager::TAB_STYLE,
485 ]
486 );
487
488 $selectors = array(
489 'normal' => '{{WRAPPER}} .wdk-locations-card-cover',
490 'hover' => '{{WRAPPER}} .wdk-locations-card-cover%1$s',
491 );
492 $this->generate_renders_tabs($selectors, 'styles_card_dynamic', ['background','border','border_radius','padding','shadow','transition']);
493
494 $this->add_responsive_control (
495 'styles_card_height',
496 [
497 'label' => esc_html__('Height', 'wpdirectorykit'),
498 'type' => Controls_Manager::SLIDER,
499 'range' => [
500 'px' => [
501 'min' => 0,
502 'max' => 1500,
503 ],
504 'vw' => [
505 'min' => 0,
506 'max' => 100,
507 ],
508 ],
509 'size_units' => [ 'px', 'vw' ],
510 'selectors' => [
511 '{{WRAPPER}} .wdk-locations-card-cover' => 'height: {{SIZE}}{{UNIT}}',
512 ],
513 'separator' => 'after',
514 ]
515 );
516
517 $this->add_responsive_control(
518 't_content_basic_position_x',
519 [
520 'label' => __( 'Position Content', 'wpdirectorykit' ),
521 'type' => Controls_Manager::CHOOSE,
522 'options' => [
523 'top' => [
524 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
525 'icon' => 'eicon-v-align-top',
526 ],
527 'center' => [
528 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
529 'icon' => 'eicon-v-align-middle',
530 ],
531 'bottom' => [
532 'title' => esc_html__( 'bottom', 'wpdirectorykit' ),
533 'icon' => ' eicon-v-align-bottom',
534 ],
535 'stretch' => [
536 'title' => esc_html__( 'Stretch', 'wpdirectorykit' ),
537 'icon' => 'eicon-v-align-stretch',
538 ],
539 ],
540 'default' => 'left',
541 'render_type' => 'template',
542 'selectors_dictionary' => [
543 'top' => 'align-items: flex-start;',
544 'center' => 'align-items: center;',
545 'bottom' => 'align-items: flex-end;',
546 'stretch' => 'align-items: stretch;',
547 ],
548 'selectors' => [
549 '{{WRAPPER}} .wdk-locations-card-cover' => '{{VALUE}};',
550 ],
551 ]
552 );
553
554 $this->add_group_control(
555 Group_Control_Css_Filter::get_type(),
556 [
557 'name' => 'css_filters',
558 'selector' => '{{WRAPPER}} .wdk-locations-card-cover .wdk-image',
559 ]
560 );
561
562 $this->add_responsive_control(
563 't_content_basic_mask',
564 [
565 'label' => esc_html__( 'Mask', 'wpdirectorykit' ),
566 'description' => esc_html__( 'Set mask for thumbnail color', 'wpdirectorykit' ),
567 'type' => Controls_Manager::COLOR,
568 'selectors' => [
569 '{{WRAPPER}} .wdk-locations-card-cover .mask' => 'background-color: {{VALUE}};',
570 ],
571 ]
572 );
573
574 $this->add_responsive_control(
575 't_content_basic_mask_hover',
576 [
577 'label' => esc_html__( 'Mask Hover', 'wpdirectorykit' ),
578 'description' => esc_html__( 'Set mask for thumbnail color', 'wpdirectorykit' ),
579 'type' => Controls_Manager::COLOR,
580 'selectors' => [
581 '{{WRAPPER}} .wdk-locations-card-cover:hover .mask' => 'background-color: {{VALUE}};',
582 ],
583 ]
584 );
585
586 $this->end_controls_section();
587
588
589 $items = [
590 [
591 'key'=>'content',
592 'label'=> esc_html__('Content', 'wpdirectorykit'),
593 'selector'=>'.wdk-locations-card-body',
594 'selector_hover'=>'.wdk-locations-card-cover%1$s .wdk-locations-card-body',
595 'options'=>['background','border','border_radius','padding','shadow','transition'],
596 ],
597 [
598 'key'=>'content_title',
599 'label'=> esc_html__('Title', 'wpdirectorykit'),
600 'selector'=>'.wdk-locations-card-cover .wdk-locations-card-body .wdk-title',
601 'selector_hover'=>'.wdk-locations-card-cover%1$s .wdk-locations-card-body .wdk-title',
602 'options'=>'full',
603 ],
604 [
605 'key'=>'content_subtitle',
606 'label'=> esc_html__('Count', 'wpdirectorykit'),
607 'selector'=>'.wdk-locations-card-cover .wdk-locations-card-body .wdk-listings-count',
608 'selector_hover'=>'.wdk-locations-card-cover%1$s .wdk-locations-card-body .wdk-listings-count',
609 'options'=>'full',
610 ],
611 [
612 'key'=>'content_button',
613 'label'=> esc_html__('Button', 'wpdirectorykit'),
614 'selector'=>'.wdk-locations-card-cover .wdk-locations-card-body .wdk-location-btn',
615 'selector_hover'=>'.wdk-locations-card-cover%1$s .wdk-locations-card-body .wdk-location-btn',
616 'options'=>['margin','align','color','background','border','border_radius','padding','shadow','transition'],
617 ],
618 ];
619
620 foreach ($items as $item) {
621 $this->start_controls_section(
622 $item['key'].'_section',
623 [
624 'label' => $item['label'],
625 'tab' => Controls_Manager::TAB_STYLE,
626 ]
627 );
628 $this->add_responsive_control(
629 $item['key'].'_hide',
630 [
631 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
632 'type' => Controls_Manager::SWITCHER,
633 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
634 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
635 'return_value' => 'none',
636 'default' => '',
637 'selectors' => [
638 '{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};',
639 ],
640 ]
641 );
642
643 $selectors = array(
644 'normal' => '{{WRAPPER}} '.$item['selector'],
645 'hover'=>'{{WRAPPER}} '.$item['selector_hover'],
646 );
647 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
648
649 if( $item['key'] =='content') {
650 $selectors = array(
651 'normal' => '{{WRAPPER}} .wdk-locations-card-cover .wdk-locations-card-body .wdk-left-content',
652 'hover'=>'{{WRAPPER}} .wdk-locations-card-cover .wdk-locations-card-body .wdk-left-content'
653 );
654 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic_padding', ['padding']);
655 }
656
657 if( $item['key'] =='content_button') {
658 $this->add_control(
659 'link_icon',
660 [
661 'label' => esc_html__('Icon', 'wpdirectorykit'),
662 'type' => Controls_Manager::ICONS,
663 'label_block' => true,
664 'default' => [
665 'value' => 'fa fa-angle-right',
666 'library' => 'solid',
667 ],
668 ]
669 );
670
671 $this->add_responsive_control (
672 'link_icon_height',
673 [
674 'label' => esc_html__('Height', 'wpdirectorykit'),
675 'type' => Controls_Manager::SLIDER,
676 'range' => [
677 'px' => [
678 'min' => 0,
679 'max' => 1500,
680 ],
681 'vw' => [
682 'min' => 0,
683 'max' => 100,
684 ],
685 ],
686 'size_units' => [ 'px', 'vw' ],
687 'selectors' => [
688 '{{WRAPPER}} .wdk-locations-card-cover .wdk-locations-card-body .wdk-location-btn' => 'font-size: {{SIZE}}{{UNIT}}',
689 ],
690 'separator' => 'after',
691 ]
692 );
693
694 }
695
696 $this->end_controls_section();
697 }
698
699 $this->start_controls_section(
700 'content_icon_section',
701 [
702 'label' => esc_html__( 'Icon', 'wpdirectorykit' ),
703 'tab' => Controls_Manager::TAB_STYLE,
704 ]
705 );
706
707 $this->add_responsive_control(
708 'content_icon_show',
709 [
710 'label' => esc_html__( 'Show Element', 'wpdirectorykit' ),
711 'type' => Controls_Manager::SWITCHER,
712 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
713 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
714 'return_value' => 'flex',
715 'default' => '',
716 'selectors' => [
717 '{{WRAPPER}} .wdk-locations-card-cover .wdk-locations-card-body .wdk-action-left' => 'display: flex;',
718 ],
719 ]
720 );
721
722
723 $this->add_control(
724 'content_icon_type',
725 [
726 'label' => __( 'Show type', 'wpdirectorykit' ),
727 'type' => \Elementor\Controls_Manager::SELECT,
728 'default' => 'font',
729 'options' => [
730 'font' => __( 'Font icon code', 'wpdirectorykit' ),
731 'image' => __( 'Image Icon', 'wpdirectorykit' ),
732 ],
733 ]
734 );
735
736 $selectors = array(
737 'normal' => '{{WRAPPER}} .wdk-locations-card-cover .wdk-locations-card-body .wdk-action-left',
738 'hover'=>'{{WRAPPER}} .wdk-locations-card-cover%1$s .wdk-locations-card-body .wdk-action-left',
739 );
740 $this->generate_renders_tabs($selectors, 'content_icon_dynamic', ['margin','color','background','border','border_radius','padding','shadow','transition']);
741
742 $this->add_control(
743 'content_icon_im_tab',
744 [
745 'label' => esc_html__('Image Icon', 'wpdirectorykit'),
746 'type' => Controls_Manager::HEADING,
747 'separator' => 'after',
748 ]
749 );
750
751 $selectors = array(
752 'normal' => '{{WRAPPER}} .wdk-locations-card-cover .wdk-locations-card-body .wdk-action-left img',
753 );
754 $this->generate_renders_tabs($selectors, 'content_icon_im_dynamic', ['image_size_control']);
755
756 $this->add_control(
757 'content_icon_f_tab',
758 [
759 'label' => esc_html__('Font Icon', 'wpdirectorykit'),
760 'type' => Controls_Manager::HEADING,
761 'separator' => 'after',
762 ]
763 );
764
765 $selectors = array(
766 'normal' => '{{WRAPPER}} .wdk-locations-card-cover .wdk-locations-card-body .wdk-action-left i',
767 );
768 $this->generate_renders_tabs($selectors, 'content_icon_f_dynamic', ['font-size']);
769
770
771 $this->end_controls_section();
772 }
773
774 private function generate_controls_content() {
775
776 }
777
778 public function enqueue_styles_scripts() {
779 wp_enqueue_style('wdk-locations-grid-cover');
780 }
781 }
782