PluginProbe
WP Directory Kit / 1.2.8
WP Directory Kit v1.2.8
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-map.php

wdk-listing-map.php in WP Directory Kit 1.2.8, at elementor-elements/classes/wdk-listing-map.php

863 lines 33.7 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 WdkListingMap 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__('InfoWindow', '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 list of categories the widget belongs to.
53 *
54 * Used to determine where to display the widget in the editor.
55 *
56 * Note that currently Elementor supports only one category.
57 * When multiple categories passed, Elementor uses the first one.
58 *
59 * @since 1.1.0
60 *
61 * @access public
62 *
63 * @return array Widget categories.
64 */
65 public function get_categories() {
66 return [ 'wdk-elementor-listing-preview' ];
67 }
68
69 /**
70 * Retrieve the widget name.
71 *
72 * @since 1.1.0
73 *
74 * @access public
75 *
76 * @return string Widget name.
77 */
78 public function get_name() {
79 return 'wdk-listing-map';
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 Map', '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-google-maps';
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('1');
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
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 /* default from settings */
145 $this->data['lat'] = wdk_get_option('wdk_default_lat', 51.505);
146 $this->data['lng'] = wdk_get_option('wdk_default_lng', -0.09);
147 $this->data['wdk_listing_id'] = $wdk_listing_id;
148
149 if(!Plugin::$instance->editor->is_edit_mode() && !empty($wdk_listing_id)) {
150 $this->data['lat'] = $this->data['lng'] = NULL;
151 if(!empty($this->data['settings']['field_id'])) {
152 if(strpos($this->data['settings']['field_id'],'__') !== FALSE){
153 $this->data['settings']['field_id'] = substr($this->data['settings']['field_id'], strpos($this->data['settings']['field_id'],'__')+2);
154 }
155
156 $gps = wdk_get_gps(wdk_field_value ($this->data['settings']['field_id'], $wdk_listing_id));
157 if($gps) {
158 $this->data['lat'] = $gps['lat'];
159 $this->data['lng'] = $gps['lng'];
160 }
161 } else {
162 $this->data['lat'] = wdk_field_value ('lat', $wdk_listing_id);
163 $this->data['lng'] = wdk_field_value ('lng', $wdk_listing_id);
164 }
165 } else {
166
167 }
168
169 $this->data['is_edit_mode']= false;
170 if(Plugin::$instance->editor->is_edit_mode() || empty($wdk_listing_id)) {
171 $this->data['is_edit_mode']= true;
172 }
173
174 echo $this->view('wdk-listing-map', $this->data);
175 }
176
177 private function generate_controls_conf() {
178 if(true){
179
180 $this->start_controls_section(
181 'conf_custom_map',
182 [
183 'label' => esc_html__('Map', 'wpdirectorykit'),
184 'tab' => '1',
185 ]
186 );
187
188
189 $this->add_control(
190 'enable_router_suggest',
191 [
192 'label' => esc_html__( 'Enable Router Suggestion', 'wpdirectorykit' ),
193 'type' => Controls_Manager::SWITCHER,
194 'none' => esc_html__( 'True', 'wpdirectorykit' ),
195 'block' => esc_html__( 'False', 'wpdirectorykit' ),
196 'render_type' => 'template',
197 'return_value' => 'yes',
198 'default' => '',
199 ]
200 );
201
202 $this->add_control(
203 'text_suggestion_route_placeholder',
204 [
205 'label' => __( 'Suggestion route placeholder', 'wpdirectorykit' ),
206 'type' => \Elementor\Controls_Manager::TEXT,
207 'rows' => 5,
208 'default' => __( 'Type your address', 'wpdirectorykit' ),
209 'conditions' => [
210 'terms' => [
211 [
212 'name' => 'enable_router_suggest',
213 'operator' => '==',
214 'value' => 'yes',
215 ]
216 ],
217 ],
218 ]
219 );
220
221 $this->add_control(
222 'text_suggestion_route',
223 [
224 'label' => __( 'Suggestion route button', 'wpdirectorykit' ),
225 'type' => \Elementor\Controls_Manager::TEXT,
226 'rows' => 5,
227 'default' => __( 'Suggest Route', 'wpdirectorykit' ),
228 'conditions' => [
229 'terms' => [
230 [
231 'name' => 'enable_router_suggest',
232 'operator' => '==',
233 'value' => 'yes',
234 ]
235 ],
236 ],
237 ]
238 );
239
240 $WMVC = &wdk_get_instance();
241 $WMVC->model('field_m');
242 $fields_data = $WMVC->field_m->get();
243 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
244 $order_i = 0;
245
246 $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
247 $fields_list [(++$order_i).'__idlisting'] = esc_html__('Id listing', 'wpdirectorykit');
248 $fields_list [(++$order_i).'__post_id'] = esc_html__('Post Id', 'wpdirectorykit');
249 $fields_list [(++$order_i).'__counter_views'] = esc_html__('Views counter', 'wpdirectorykit');
250 $fields_list [(++$order_i).'__lat'] = esc_html__('Gps Lat', 'wpdirectorykit');
251 $fields_list [(++$order_i).'__lng'] = esc_html__('Gps Lng', 'wpdirectorykit');
252 $fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit');
253 $fields_list [(++$order_i).'__date_modified'] = esc_html__('Date Modified', 'wpdirectorykit');
254 $fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit');
255 $fields_list [(++$order_i).'__post_content'] = esc_html__('WP Content', 'wpdirectorykit');
256 $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit');
257 $fields_list [(++$order_i).'__category_id'] = esc_html__('Category', 'wpdirectorykit');
258 $fields_list [(++$order_i).'__location_id'] = esc_html__('Location', 'wpdirectorykit');
259
260 foreach($fields_data as $field)
261 {
262 if(wmvc_show_data('field_type', $field) == 'SECTION') {
263 $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --';
264 } else {
265 $fields_list[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
266 }
267 }
268 $this->add_control(
269 'field_id',
270 [
271 'label' => __( 'Marker position based on field with address (Detected gps by api)', 'wpdirectorykit' ),
272 'type' => \Elementor\Controls_Manager::SELECT,
273 'default' => '',
274 'options' => $fields_list,
275 'separator' => 'after',
276 ]
277 );
278
279 $this->add_responsive_control(
280 'conf_custom_map_height',
281 [
282 'label' => esc_html__('Height', 'wpdirectorykit'),
283 'type' => Controls_Manager::SLIDER,
284 'range' => [
285 'px' => [
286 'min' => 100,
287 'max' => 1500,
288 ],
289 ],
290 'render_type' => 'template',
291 'default' => [
292 'size' => 350,
293 ],
294 'selectors' => [
295 '{{WRAPPER}} .wdk-element #wdk_map_results' => 'height: {{SIZE}}px !important',
296 ],
297 'separator' => 'after',
298 ]
299 );
300
301 $this->add_control(
302 'conf_custom_map_zoom_index',
303 [
304 'label' => esc_html__('Zoom Index', 'wpdirectorykit'),
305 'description' => esc_html__( 'Only active if auto centering is disabled', 'wpdirectorykit' ),
306 'type' => Controls_Manager::SLIDER,
307 'range' => [
308 'px' => [
309 'min' => 1,
310 'max' => 18,
311 ],
312 ],
313 'render_type' => 'template',
314 'default' => [
315 'size' => 7,
316 ],
317 ]
318 );
319
320 $this->add_responsive_control(
321 'conf_custom_dragging',
322 [
323 'label' => esc_html__( 'Dragging', 'wpdirectorykit' ),
324 'type' => Controls_Manager::SWITCHER,
325 'none' => esc_html__( 'True', 'wpdirectorykit' ),
326 'block' => esc_html__( 'False', 'wpdirectorykit' ),
327 'render_type' => 'template',
328 'return_value' => 'yes',
329 'default' => 'yes',
330 'separator' => 'before',
331 ]
332 );
333
334
335 $this->add_responsive_control(
336 'conf_custom_popup_enable',
337 [
338 'label' => esc_html__( 'Enable Infobox', 'wpdirectorykit' ),
339 'type' => Controls_Manager::SWITCHER,
340 'none' => esc_html__( 'True', 'wpdirectorykit' ),
341 'block' => esc_html__( 'False', 'wpdirectorykit' ),
342 'render_type' => 'template',
343 'return_value' => 'yes',
344 'default' => 'yes',
345 'separator' => 'before',
346 ]
347 );
348
349 $this->add_responsive_control(
350 'puopup_custom_content',
351 [
352 'label' => esc_html__( 'Custom Fields For Infobox', 'wpdirectorykit' ),
353 'type' => Controls_Manager::SWITCHER,
354 'none' => esc_html__( 'True', 'wpdirectorykit' ),
355 'block' => esc_html__( 'False', 'wpdirectorykit' ),
356 'render_type' => 'template',
357 'return_value' => 'yes',
358 'default' => '',
359 'conditions' => [
360 'terms' => [
361 [
362 'name' => 'conf_custom_popup_enable',
363 'operator' => '==',
364 'value' => 'yes',
365 ]
366 ],
367 ]
368 ]
369 );
370
371
372 $this->add_control(
373 'conf_custom_map_styles_h',
374 [
375 'label' => __( 'Map Styles', 'wpdirectorykit' ),
376 'type' => \Elementor\Controls_Manager::HEADING,
377 'separator' => 'before',
378 ]
379 );
380
381 $this->add_control(
382 'conf_custom_map_style',
383 [
384 'label' => esc_html__('Styles List', 'wpdirectorykit'),
385 'type' => Controls_Manager::SELECT,
386 'options' => [
387 '' => esc_html__('Default', 'wpdirectorykit'),
388 'custom' => esc_html__('Custom', 'wpdirectorykit'),
389 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Light', 'wpdirectorykit'),
390 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png' => esc_html__('Osmde', 'wpdirectorykit'),
391 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png' => esc_html__('OpenTopoMap', 'wpdirectorykit'),
392 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' => esc_html__('OpenCycleMap', 'wpdirectorykit'),
393 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' => esc_html__('WorldImagery', 'wpdirectorykit'),
394 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Carto DarkMatter', 'wpdirectorykit'),
395 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png' => esc_html__('Carto Voyager', 'wpdirectorykit'),
396 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png' => esc_html__('Maptiler dark (demo)', 'wpdirectorykit'),
397 ],
398 'default' => '',
399 ]
400 );
401
402 $this->add_control(
403 'conf_custom_map_style_self',
404 [
405 'label' => esc_html__('Link to custom Map Style', 'wpdirectorykit'),
406 'description' => esc_html__( 'You can add some custom map by link example https://leaflet-extras.github.io/leaflet-providers/preview/ or create your custom style and put link for example on maps.cloudmade.com/editor', 'wpdirectorykit' ),
407 'type' => Controls_Manager::TEXTAREA,
408 'render_type' => 'template',
409 'conditions' => [
410 'terms' => [
411 [
412 'name' => 'conf_custom_map_style',
413 'operator' => '==',
414 'value' => 'custom',
415 ]
416 ],
417 ]
418 ]
419 );
420
421
422
423 $this->end_controls_section();
424 }
425
426
427 $this->start_controls_section(
428 'tab_conf_main_section',
429 [
430 'label' => esc_html__('Custom Popup Fields', 'wpdirectorykit'),
431 'tab' => '1',
432 'conditions' => [
433 'terms' => [
434 [
435 'name' => 'puopup_custom_content',
436 'operator' => '==',
437 'value' => 'yes',
438 ]
439 ],
440 ]
441 ]
442 );
443
444 $WMVC = &wdk_get_instance();
445 $WMVC->model('field_m');
446 $fields_data = $WMVC->field_m->get();
447 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
448 $order_i = 0;
449
450 $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
451 $fields_list [(++$order_i).'__idlisting'] = esc_html__('Id listing', 'wpdirectorykit');
452 $fields_list [(++$order_i).'__post_id'] = esc_html__('Post Id', 'wpdirectorykit');
453 $fields_list [(++$order_i).'__counter_views'] = esc_html__('Views counter', 'wpdirectorykit');
454 $fields_list [(++$order_i).'__lat'] = esc_html__('Gps Lat', 'wpdirectorykit');
455 $fields_list [(++$order_i).'__lng'] = esc_html__('Gps Lng', 'wpdirectorykit');
456 $fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit');
457 $fields_list [(++$order_i).'__date_modified'] = esc_html__('Date Modified', 'wpdirectorykit');
458 $fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit');
459 $fields_list [(++$order_i).'__post_content'] = esc_html__('WP Content', 'wpdirectorykit');
460 $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit');
461 $fields_list [(++$order_i).'__category_id'] = esc_html__('Category', 'wpdirectorykit');
462 $fields_list [(++$order_i).'__location_id'] = esc_html__('Location', 'wpdirectorykit');
463
464 foreach($fields_data as $field)
465 {
466 if(wmvc_show_data('field_type', $field) == 'SECTION') {
467 $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --';
468 } else {
469 $fields_list[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
470 }
471 }
472 $this->add_control(
473 'title_field_id',
474 [
475 'label' => __( 'Title Field', 'wpdirectorykit' ),
476 'type' => \Elementor\Controls_Manager::SELECT,
477 'default' => '',
478 'options' => $fields_list,
479 ]
480 );
481
482 $this->add_control(
483 'content_field_id',
484 [
485 'label' => __( 'Content Field', 'wpdirectorykit' ),
486 'type' => \Elementor\Controls_Manager::SELECT,
487 'default' => '',
488 'options' => $fields_list,
489 ]
490 );
491
492 $this->end_controls_section();
493
494 }
495
496 private function generate_controls_layout() {
497
498 /* default marker layout */
499 $this->generate_controls_layout_default();
500 }
501
502 private function generate_controls_styles() {
503 /* marker */
504 $this->start_controls_section(
505 'styles_marker_sec',
506 [
507 'label' => esc_html__('Marker', 'wpdirectorykit'),
508 'tab' => Controls_Manager::TAB_STYLE,
509 ]
510 );
511
512
513 $this->add_control(
514 'styles_marker_h',
515 [
516 'label' => esc_html__('Marker', 'wpdirectorykit'),
517 'type' => Controls_Manager::HEADING,
518 'separator' => 'before',
519 ]
520 );
521
522 $this->start_controls_tabs('marker_button_style');
523
524 $this->start_controls_tab(
525 'marker',
526 [
527 'label' => esc_html__('Normal', 'wpdirectorykit'),
528 ]
529 );
530
531 $this->add_control(
532 'styles_marker_color',
533 [
534 'label' => esc_html__('Marker Border Color', 'wpdirectorykit'),
535 'type' => Controls_Manager::COLOR,
536 'selectors' => [
537 '{{WRAPPER}} .wdk-element .wdk-map .wdk_marker-card::before' => 'background-color: {{VALUE}};',
538 ],
539 ]
540 );
541
542 $this->add_control(
543 'styles_marker_color_bckg',
544 [
545 'label' => esc_html__('Marker Color', 'wpdirectorykit'),
546 'type' => Controls_Manager::COLOR,
547 'selectors' => [
548 '{{WRAPPER}} .wdk-element .wdk_marker-card:after' => 'background-color: {{VALUE}};',
549 ],
550 ]
551 );
552
553 $this->add_control(
554 'styles_marker_color_text',
555 [
556 'label' => esc_html__('Marker Text Color', 'wpdirectorykit'),
557 'type' => Controls_Manager::COLOR,
558 'selectors' => [
559 '{{WRAPPER}} .wdk_face i' => 'color: {{VALUE}};',
560 ],
561 ]
562 );
563
564 $this->add_control(
565 'conf_custom_map_pin_icon',
566 [
567 'label' => esc_html__('Icon', 'wpdirectorykit'),
568 'type' => Controls_Manager::ICONS,
569 'label_block' => true,
570 'default' => [
571 'value' => 'fa fa-home',
572 'library' => 'solid',
573 ],
574 ]
575 );
576
577 $this->add_control(
578 'conf_custom_map_pin',
579 [
580 'label' => esc_html__('Custom Marker Pin Image', 'wpdirectorykit'),
581 'type' => Controls_Manager::MEDIA,
582 ]
583 );
584
585 $this->end_controls_tab();
586
587 $this->start_controls_tab(
588 'marker_hover',
589 [
590 'label' => esc_html__('Hover', 'wpdirectorykit'),
591 ]
592 );
593
594 $this->add_control(
595 'styles_marker_color_hover',
596 [
597 'label' => esc_html__('Marker Border Color', 'wpdirectorykit'),
598 'type' => Controls_Manager::COLOR,
599 'selectors' => [
600 '{{WRAPPER}} .wdk-element .wdk_marker-container:hover .wdk_marker-card:before' => 'background-color: {{VALUE}};',
601 ],
602 ]
603 );
604
605 $this->add_control(
606 'styles_marker_color_hover_bckg',
607 [
608 'label' => esc_html__('Marker Color', 'wpdirectorykit'),
609 'type' => Controls_Manager::COLOR,
610 'selectors' => [
611 '{{WRAPPER}} .wdk-element .wdk_marker-container:hover .wdk_marker-card:after' => 'background-color: {{VALUE}};',
612 ],
613 ]
614 );
615
616 $this->add_control(
617 'styles_marker_color_text_hover',
618 [
619 'label' => esc_html__('Marker Text Color', 'wpdirectorykit'),
620 'type' => Controls_Manager::COLOR,
621 'selectors' => [
622 '{{WRAPPER}} .wdk_marker-container:hover .wdk_face.back i, .wdk_marker-container:hover .wdk_face i' => 'color: {{VALUE}};',
623 ],
624 ]
625 );
626
627 $this->add_control(
628 'styles_marker_effect_duration',
629 [
630 'label' => esc_html__('Transition Duration', 'wpdirectorykit'),
631 'type' => Controls_Manager::SLIDER,
632 'render_type' => 'template',
633 'range' => [
634 'px' => [
635 'min' => 0,
636 'max' => 3000,
637 ],
638 ],
639 'selectors' => [
640 '{{WRAPPER}} .wdk_map-marker-container.clicked .wdk_face.front, .wdk_marker-container:hover .wdk_face.front' => 'transition-duration: {{SIZE}}ms',
641 ],
642 ]
643 );
644
645 $this->end_controls_tab();
646
647 $this->end_controls_tabs();
648 $this->end_controls_section();
649
650 $this->start_controls_section(
651 'section_form_suggestion',
652 [
653 'label' => __( 'Form Suggestion Route', 'wpdirectorykit' ),
654 'tab' => Controls_Manager::TAB_STYLE,
655 'conditions' => [
656 'terms' => [
657 [
658 'name' => 'enable_router_suggest',
659 'operator' => '==',
660 'value' => 'yes',
661 ]
662 ],
663 ],
664 ]
665 );
666
667
668 $this->add_responsive_control (
669 'form_suggestion_style_align',
670 [
671 'label' => __( 'Position', 'wpdirectorykit' ),
672 'type' => Controls_Manager::CHOOSE,
673 'options' => [
674 'left' => [
675 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
676 'icon' => 'eicon-text-align-left',
677 ],
678 'center' => [
679 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
680 'icon' => 'eicon-text-align-center',
681 ],
682 'right' => [
683 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
684 'icon' => 'eicon-text-align-right',
685 ],
686 'justify' => [
687 'title' => esc_html__( 'Default', 'wpdirectorykit' ),
688 'icon' => 'eicon-text-align-justify',
689 ] ,
690 ],
691 'render_type' => 'ui',
692 'selectors_dictionary' => [
693 'left' => 'flex-start',
694 'center' => 'center',
695 'right' => 'flex-end',
696 'justify' => 'space-between',
697 ],
698 'selectors' => [
699 '{{WRAPPER}} .route_suggestion' => 'justify-content:{{VALUE}};',
700 ],
701 ]
702 );
703
704 $this->add_responsive_control(
705 'form_suggestion_column_direct',
706 [
707 'label' => __( 'Direction', 'wpdirectorykit' ),
708 'type' => Controls_Manager::SELECT,
709 'options' => [
710 '' => esc_html__('Default', 'wpdirectorykit'),
711 'row' => esc_html__('Row', 'wpdirectorykit'),
712 'row-reverse' => esc_html__('Row reverse', 'wpdirectorykit'),
713 'column' => esc_html__('Column', 'wpdirectorykit'),
714 'column-reverse' => esc_html__('Column reverse', 'wpdirectorykit'),
715 ],
716 'selectors' => [
717 '{{WRAPPER}} .route_suggestion' => 'flex-direction: {{UNIT}}',
718 ],
719 'separator' => 'before',
720 ]
721 );
722
723 $this->add_responsive_control(
724 'form_suggestion_column_gap',
725 [
726 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
727 'type' => Controls_Manager::SLIDER,
728 'default' => [
729 'size' => 10,
730 ],
731 'range' => [
732 'px' => [
733 'min' => 0,
734 'max' => 60,
735 ],
736 ],
737 'selectors' => [
738 '{{WRAPPER}} .route_suggestion > *' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
739 '{{WRAPPER}} .route_suggestion' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
740 ],
741 ]
742 );
743
744 $this->add_responsive_control(
745 'form_suggestion_row_gap',
746 [
747 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
748 'type' => Controls_Manager::SLIDER,
749 'default' => [
750 'size' => 10,
751 ],
752 'range' => [
753 'px' => [
754 'min' => 0,
755 'max' => 60,
756 ],
757 ],
758 'selectors' => [
759 '{{WRAPPER}} .route_suggestion > *' => 'margin-bottom: {{SIZE}}{{UNIT}};',
760 '{{WRAPPER}} .route_suggestion ' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
761 ],
762 ]
763 );
764
765
766 $this->add_responsive_control(
767 'form_suggestion_space_top',
768 [
769 'label' => esc_html__('Space Top', 'wpdirectorykit'),
770 'type' => Controls_Manager::SLIDER,
771 'default' => [
772 'size' => 25,
773 ],
774 'range' => [
775 'px' => [
776 'min' => 0,
777 'max' => 500,
778 ],
779 ],
780 'selectors' => [
781 '{{WRAPPER}} .route_suggestion' => 'margin-top: {{SIZE}}{{UNIT}};',
782 ],
783 ]
784 );
785
786 $this->add_control(
787 'form_suggestion_header_1',
788 [
789 'label' => __( 'Input', 'wpdirectorykit' ),
790 'type' => Controls_Manager::HEADING,
791 ]
792 );
793
794 $selectors = array(
795 'normal' => '{{WRAPPER}} .route_suggestion .input_text',
796 );
797
798 $this->generate_renders_tabs($selectors, 'form_suggestion_input_dynamic', ['typo','color','background','border','border_radius','padding','shadow','transition', 'height', 'width']);
799
800
801 $this->add_control(
802 'form_suggestion_header_2',
803 [
804 'label' => __( 'Placeholder', 'wpdirectorykit' ),
805 'type' => Controls_Manager::HEADING,
806 ]
807 );
808
809 $selectors = array(
810 'normal' => '{{WRAPPER}} .route_suggestion .input_text::placeholder',
811 );
812
813 $this->generate_renders_tabs($selectors, 'form_suggestion_input_pl_dynamic', ['align','typo','color']);
814
815 $this->add_control(
816 'form_suggestion_header_3',
817 [
818 'label' => __( 'Submit Button', 'wpdirectorykit' ),
819 'type' => Controls_Manager::HEADING,
820 ]
821 );
822
823 $selectors = array(
824 'normal' => '{{WRAPPER}} .route_suggestion .wdk-btn',
825 'hover' => '{{WRAPPER}} .route_suggestion .wdk-btn%1$s',
826 );
827
828 $this->generate_renders_tabs($selectors, 'form_suggestion_btn_dynamic', ['typo', 'color', 'border', 'border_radius', 'shadow', 'transition', 'background_group','padding']);
829
830 $this->end_controls_section();
831 }
832
833 private function generate_controls_content() {
834 }
835
836 private function generate_controls_layout_default() {
837
838 }
839
840 private function generate_controls_styles_default() {
841
842 }
843
844 public function enqueue_styles_scripts() {
845 wp_enqueue_style('leaflet');
846 wp_enqueue_style('leaflet-cluster-def');
847 wp_enqueue_style('leaflet-cluster');
848 wp_enqueue_script('leaflet');
849 wp_enqueue_script('leaflet-cluster');
850 wp_enqueue_script('leaflet-fullscreen');
851 wp_enqueue_style('leaflet-fullscreen');
852
853 wp_enqueue_style('wdk-notify');
854 wp_enqueue_script('wdk-notify');
855 wp_enqueue_style( 'wdk-listings-map' );
856
857 wp_enqueue_style('slick');
858 wp_enqueue_style('slick-theme');
859 wp_enqueue_style('wdk-hover');
860 wp_enqueue_script('slick');
861 }
862 }
863