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

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

1,384 lines 58.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 WdkMap 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 parent::__construct($data, $args);
44
45 if ($this->is_edit_mode_load()) {
46 wp_enqueue_style('leaflet');
47 wp_enqueue_style('leaflet-cluster-def');
48 wp_enqueue_style('leaflet-cluster');
49 wp_enqueue_style('leaflet-fullscreen');
50 wp_enqueue_script('leaflet');
51 wp_enqueue_script('leaflet-fullscreen');
52 wp_enqueue_script('leaflet-cluster');
53
54 wp_enqueue_style('wdk-notify');
55 wp_enqueue_script('wdk-notify');
56 wp_enqueue_style( 'wdk-listings-map' );
57 $this->enqueue_styles_scripts();
58 }
59 }
60
61 /**
62 * Retrieve the widget name.
63 *
64 * @since 1.1.0
65 *
66 * @access public
67 *
68 * @return string Widget name.
69 */
70 public function get_name() {
71 return 'wdk-map';
72 }
73
74 /**
75 * Retrieve the widget title.
76 *
77 * @since 1.1.0
78 *
79 * @access public
80 *
81 * @return string Widget title.
82 */
83 public function get_title() {
84 return esc_html__('Wdk Map', 'wpdirectorykit');
85 }
86
87 /**
88 * Retrieve the widget icon.
89 *
90 * @since 1.1.0
91 *
92 * @access public
93 *
94 * @return string Widget icon.
95 */
96 public function get_icon() {
97 return 'eicon-google-maps';
98 }
99
100 /**
101 * Register the widget controls.
102 *
103 * Adds different input fields to allow the user to change and customize the widget settings.
104 *
105 * @since 1.1.0
106 *
107 * @access protected
108 */
109 protected function register_controls() {
110 $this->generate_controls_conf();
111 $this->generate_controls_layout();
112 $this->generate_controls_styles();
113 $this->generate_controls_content();
114
115 $this->insert_pro_message('1');
116 parent::register_controls();
117 }
118
119 /**
120 * Render the widget output on the frontend.
121 *
122 * Written in PHP and used to generate the final HTML.
123 *
124 * @since 1.1.0
125 *
126 * @access protected
127 */
128 protected function render() {
129 parent::render();
130
131 /* default from settings */
132 $this->data['lat'] = wdk_get_option('wdk_default_lat', 51.505);
133 $this->data['lng'] = wdk_get_option('wdk_default_lng', -0.09);
134
135 $this->data['id_element'] = $this->get_id();
136 $this->data['settings'] = $this->get_settings();
137 $columns = array('ID', 'location_id', 'category_id', 'post_title', 'post_date', 'search', 'order_by','is_featured', 'address');
138 $controller = 'listing';
139 $custom_parameters = array();
140
141 if($this->data['settings']['enable_custom_gps_center'] == 'yes') {
142 $this->data['lat'] = $this->data['settings']['conf_custom_map_center_gps_lat'];
143 $this->data['lng'] = $this->data['settings']['conf_custom_map_center_gps_lng'];
144 }
145
146 if(!isset($_GET['order_by'])) {
147 $custom_parameters['order_by'] = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
148 }
149
150 if(!isset($_GET['conf_order_by_custom'])) {
151 $custom_parameters['order_by'] = $this->data['settings']['conf_order_by_custom'].' '.$this->data['settings']['conf_order'];
152 }
153
154 if(!empty($this->data['settings']['conf_query'])) {
155 $qr_string = trim($this->data['settings']['conf_query'],'?');
156 $string_par = array();
157 parse_str($qr_string, $string_par);
158 $custom_parameters += array_map('trim', $string_par);
159 }
160
161 $external_columns = array('location_id', 'category_id', 'post_title');
162 wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters);
163 $this->data['results'] = $this->WMVC->listing_m->get_pagination($this->data['settings']['conf_limit'], NULL, array('is_activated' => 1,'is_approved'=>1));
164
165 $this->data['settings']['content_button_icon'] = '';
166
167 $this->data['is_edit_mode']= false;
168 if(Plugin::$instance->editor->is_edit_mode())
169 $this->data['is_edit_mode']= true;
170
171 $this->view('wdk-map', $this->data, true);
172
173 }
174
175 private function generate_controls_conf() {
176 $this->start_controls_section(
177 'tab_conf_main_section',
178 [
179 'label' => esc_html__('Main', 'wpdirectorykit'),
180 'tab' => '1',
181 ]
182 );
183
184 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){
185 $this->add_control(
186 'is_custom_layout_enable',
187 [
188 'label' => __( 'Enable Custom Layout', 'wpdirectorykit' ),
189 'type' => \Elementor\Controls_Manager::SWITCHER,
190 'label_on' => __( 'True', 'wpdirectorykit' ),
191 'label_off' => __( 'False', 'wpdirectorykit' ),
192 'return_value' => 'yes',
193 'default' => '',
194
195 ]
196 );
197 $this->add_control(
198 'custom_layout_id',
199 [
200 'label' => __( 'Layout Template id', 'wpdirectorykit' ),
201 'type' => \Elementor\Controls_Manager::TEXT,
202 'default' => '',
203 'placeholder' => __( 'put your template id', 'wpdirectorykit' ),
204 'description' => __( 'Create layout here', 'wpdirectorykit' ) . ' ' . wdk_sprintf(
205 /* translators: 1: Tag with link open, 2: close link tag. */
206 __('%1$s here %2$s', 'wpdirectorykit'),
207 '<a target="_blank" href="' . esc_urL(admin_url('edit.php?post_type=elementor_library#add_new')) . '">',
208 '</a>'
209 ),
210 'conditions' => [
211 'terms' => [
212 [
213 'name' => 'is_custom_layout_enable',
214 'operator' => '==',
215 'value' => 'yes',
216 ]
217 ],
218 ],
219 ]
220 );
221 }
222
223 if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')){
224 $this->add_control(
225 'is_ajax_enable',
226 [
227 'label' => __( 'Enable Reload content with ajax', 'wpdirectorykit' ),
228 'type' => \Elementor\Controls_Manager::SWITCHER,
229 'label_on' => __( 'True', 'wpdirectorykit' ),
230 'label_off' => __( 'False', 'wpdirectorykit' ),
231 'return_value' => 'yes',
232 'default' => '',
233
234 ]
235 );
236 }
237
238 /* conf_results_type :: results_listings */
239 if(true){
240 $this->add_control(
241 'conf_results_type_results_listings_header',
242 [
243 'label' => esc_html__('Results listings', 'wpdirectorykit'),
244 'type' => Controls_Manager::HEADING,
245 'separator' => 'before',
246 ]
247 );
248
249 $this->add_control(
250 'conf_hide_real_location',
251 [
252 'label' => esc_html__( 'Hide real location', 'wpdirectorykit' ),
253 'type' => Controls_Manager::SWITCHER,
254 'none' => esc_html__( 'True', 'wpdirectorykit' ),
255 'block' => esc_html__( 'False', 'wpdirectorykit' ),
256 'render_type' => 'template',
257 'return_value' => 'yes',
258 'default' => '',
259 ]
260 );
261
262 $this->add_control(
263 'enable_rectangle_auto_search',
264 [
265 'label' => esc_html__( 'Recangle auto search', 'wpdirectorykit' ),
266 'type' => Controls_Manager::SWITCHER,
267 'none' => esc_html__( 'True', 'wpdirectorykit' ),
268 'block' => esc_html__( 'False', 'wpdirectorykit' ),
269 'render_type' => 'template',
270 'return_value' => 'yes',
271 'default' => 'yes',
272 ]
273 );
274
275 $this->add_control(
276 'disable_rectangle',
277 [
278 'label' => esc_html__( 'Disable Rectangle Search', 'wpdirectorykit' ),
279 'type' => Controls_Manager::SWITCHER,
280 'none' => esc_html__( 'True', 'wpdirectorykit' ),
281 'block' => esc_html__( 'False', 'wpdirectorykit' ),
282 'render_type' => 'template',
283 'return_value' => 'yes',
284 'default' => '',
285 ]
286 );
287
288 $this->add_control(
289 'enable_scrollWheelZoom',
290 [
291 'label' => esc_html__( 'Enable scrollWheelZoom', 'wpdirectorykit' ),
292 'type' => Controls_Manager::SWITCHER,
293 'none' => esc_html__( 'True', 'wpdirectorykit' ),
294 'block' => esc_html__( 'False', 'wpdirectorykit' ),
295 'render_type' => 'template',
296 'return_value' => 'yes',
297 'default' => '',
298 'separator' => 'after',
299 ]
300 );
301
302 $this->add_control(
303 'conf_limit',
304 [
305 'label' => __( 'Limit Results', 'wpdirectorykit' ),
306 'type' => \Elementor\Controls_Manager::NUMBER,
307 'min' => 1,
308 'max' => 10000,
309 'step' => 1,
310 'default' => 350,
311 ]
312 );
313
314 $this->add_control(
315 'conf_query',
316 [
317 'label' => __( 'Query', 'wpdirectorykit' ),
318 'type' => \Elementor\Controls_Manager::TEXTAREA,
319 'rows' => 5,
320 'default' => '',
321 'placeholder' => __( 'Type your query here, example xxx', 'wpdirectorykit' ),
322 'description' => '<span style="word-break: break-all;">'.__( 'Example (same like on url):', 'wpdirectorykit' ).
323 ' field_6_min=100&field_6_max=200&field_5=rent&is_featured=on&search_category=3&search_location=4&search_agents_ids=3'.
324 '</span>',
325 ]
326 );
327
328 $this->add_control(
329 'conf_order_by',
330 [
331 'label' => __('Default Sort By Column', 'wpdirectorykit'),
332 'type' => Controls_Manager::SELECT,
333 'label_block' => true,
334 'options' => [
335 'none' => __('None', 'wpdirectorykit'),
336 'post_id' => __('ID', 'wpdirectorykit'),
337 'category_id' => __('Category', 'wpdirectorykit'),
338 ],
339 'default' => 'post_id',
340 ]
341 );
342
343 $this->add_control(
344 'conf_order_by_custom',
345 [
346 'label' => __('Default Custom Sort By (Column)', 'wpdirectorykit'),
347 'description' => '<span style="word-break: break-all;">'.__( 'Example:', 'wpdirectorykit' ).
348 '<br> field_13_NUMBER - where 13 is field id, NUMBER - field type'.
349 '<br> field_4_NUMBER - where 4 is field id, NUMBER - field type'.
350 '<br> field_6_DROPDOWN - where 6 is field id, DROPDOWN - field type'.
351 '<br> category_title - Category Title'.
352 '<br> location_title - Location Title'.
353 '</span>',
354 'type' => Controls_Manager::TEXT,
355 'label_block' => true,
356 'default' => 'post_id',
357 ]
358 );
359
360 $this->add_control(
361 'conf_order',
362 [
363 'label' => __('Default Listing Order', 'wpdirectorykit'),
364 'type' => Controls_Manager::SELECT,
365 'label_block' => true,
366 'options' => [
367 'asc' => __('Ascending', 'wpdirectorykit'),
368 'desc' => __('Descending', 'wpdirectorykit')
369 ],
370 'default' => 'desc',
371 ]
372 );
373
374 }
375
376 $this->end_controls_section();
377
378 if(true){
379 $this->start_controls_section(
380 'conf_custom_map',
381 [
382 'label' => esc_html__('Map', 'wpdirectorykit'),
383 'tab' => '1',
384 ]
385 );
386
387 $this->add_responsive_control(
388 'conf_custom_map_height',
389 [
390 'label' => esc_html__('Height', 'wpdirectorykit'),
391 'type' => Controls_Manager::SLIDER,
392 'range' => [
393 'px' => [
394 'min' => 100,
395 'max' => 1500,
396 ],
397 ],
398 'render_type' => 'template',
399 'default' => [
400 'size' => 350,
401 ],
402 'selectors' => [
403 '{{WRAPPER}} .wdk-element .wdk_map_results' => 'height: {{SIZE}}px !important',
404 ],
405 'separator' => 'after',
406 ]
407 );
408
409 $this->add_control(
410 'conf_custom_map_zoom_index',
411 [
412 'label' => esc_html__('Zoom Index', 'wpdirectorykit'),
413 'description' => esc_html__( 'Only active if auto centering is disabled', 'wpdirectorykit' ),
414 'type' => Controls_Manager::SLIDER,
415 'range' => [
416 'px' => [
417 'min' => 1,
418 'max' => 18,
419 ],
420 ],
421 'render_type' => 'template',
422 'default' => [
423 'size' => 7,
424 ]
425 ]
426 );
427
428 $this->add_control(
429 'conf_custom_dragging',
430 [
431 'label' => esc_html__( 'Dragging For Desktop', 'wpdirectorykit' ),
432 'type' => Controls_Manager::SWITCHER,
433 'none' => esc_html__( 'True', 'wpdirectorykit' ),
434 'block' => esc_html__( 'False', 'wpdirectorykit' ),
435 'render_type' => 'template',
436 'return_value' => 'yes',
437 'default' => 'yes',
438 'separator' => 'before',
439 ]
440 );
441
442 $this->add_control(
443 'conf_custom_dragging_mobile',
444 [
445 'label' => esc_html__( 'Dragging For Mobile', 'wpdirectorykit' ),
446 'type' => Controls_Manager::SWITCHER,
447 'none' => esc_html__( 'True', 'wpdirectorykit' ),
448 'block' => esc_html__( 'False', 'wpdirectorykit' ),
449 'render_type' => 'template',
450 'return_value' => 'yes',
451 'default' => '',
452 'separator' => 'before',
453 ]
454 );
455
456 $this->add_control(
457 'conf_custom_map_styles_h',
458 [
459 'label' => __( 'Map Styles', 'wpdirectorykit' ),
460 'type' => \Elementor\Controls_Manager::HEADING,
461 'separator' => 'before',
462 ]
463 );
464
465 $this->add_control(
466 'conf_custom_map_style',
467 [
468 'label' => esc_html__('Styles List', 'wpdirectorykit'),
469 'type' => Controls_Manager::SELECT,
470 'options' => [
471 '' => esc_html__('Default', 'wpdirectorykit'),
472 'custom' => esc_html__('Custom', 'wpdirectorykit'),
473 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Light', 'wpdirectorykit'),
474 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png' => esc_html__('Osmde', 'wpdirectorykit'),
475 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png' => esc_html__('Osmde Fr', 'wpdirectorykit'),
476 'https://tile.openstreetmap.de/{z}/{x}/{y}.png' => esc_html__('Osmde De', 'wpdirectorykit'),
477 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' => esc_html__('Mapnik', 'wpdirectorykit'),
478 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png' => esc_html__('OpenTopoMap', 'wpdirectorykit'),
479 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' => esc_html__('WorldImagery', 'wpdirectorykit'),
480 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Carto DarkMatter', 'wpdirectorykit'),
481 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png' => esc_html__('Carto Voyager', 'wpdirectorykit'),
482 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png' => esc_html__('Maptiler dark (demo)', 'wpdirectorykit'),
483 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png' => esc_html__('Thunderforest MobileAtlas', 'wpdirectorykit'),
484 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' => esc_html__('Thunderforest OpenCycleMap', 'wpdirectorykit'),
485 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png' => esc_html__('Thunderforest TransportDark', 'wpdirectorykit'),
486 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png' => esc_html__('Thunderforest Landscape', 'wpdirectorykit'),
487 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png' => esc_html__('Thunderforest Outdoors', 'wpdirectorykit'),
488 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png' => esc_html__('Thunderforest Pioneer', 'wpdirectorykit'),
489 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png' => esc_html__('Thunderforest Neighbourhood', 'wpdirectorykit'),
490 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png' => esc_html__('CyclOSM', 'wpdirectorykit'),
491 'https://{s}.tile.jawg.io/jawg-terrain/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Streets', 'wpdirectorykit'),
492 'https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Sunny', 'wpdirectorykit'),
493 'https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Dark', 'wpdirectorykit'),
494 'https://{s}.tile.jawg.io/jawg-light/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Light', 'wpdirectorykit'),
495 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}' => esc_html__('World Top oMap', 'wpdirectorykit'),
496 'google_map' => esc_html__('Google Map Layout', 'wpdirectorykit'),
497 ],
498 'default' => '',
499 ]
500 );
501
502 $this->add_control(
503 'jawg_map_key',
504 [
505 'label' => __( 'Jawg Map API Key', 'wpdirectorykit' ),
506 /* translators: 1: URL. */
507 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.jawg.io/en/pricing')
508 /* translators: 1: URL. */
509 .' '.wdk_sprintf(__( 'or check demo maps <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.jawg.io/en/maps'),
510 'type' => \Elementor\Controls_Manager::TEXT,
511 'default' => '',
512 'condition' => [
513 'conf_custom_map_style' => [
514 'https://{s}.tile.jawg.io/jawg-terrain/{z}/{x}/{y}{r}.png',
515 'https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png',
516 'https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png',
517 'https://{s}.tile.jawg.io/jawg-light/{z}/{x}/{y}{r}.png',
518 ],
519 ],
520 ]
521 );
522
523 $this->add_control(
524 'carto_map_key',
525 [
526 'label' => __( 'Carto Map API Key', 'wpdirectorykit' ),
527 /* translators: 1: URL. */
528 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://carto.com/basemaps/apikey/'),
529 'type' => \Elementor\Controls_Manager::TEXT,
530 'default' => '',
531 'condition' => [
532 'conf_custom_map_style' => [
533 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png',
534 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png',
535 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png',
536 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png',
537 ],
538 ],
539 ]
540 );
541
542 $this->add_control(
543 'thunderforest_map_key',
544 [
545 'label' => __( 'Thunderforest Map API Key', 'wpdirectorykit' ),
546 /* translators: 1: URL. */
547 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.thunderforest.com/pricing/'),
548 'type' => \Elementor\Controls_Manager::TEXT,
549 'default' => '',
550 'condition' => [
551 'conf_custom_map_style' => [
552 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png',
553 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png',
554 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png',
555 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png',
556 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png',
557 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png',
558 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png',
559 ],
560 ],
561 ]
562 );
563
564 $this->add_control(
565 'google_map_key',
566 [
567 'label' => __( 'Google Map API Key', 'wpdirectorykit' ),
568 /* translators: 1: URL. */
569 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://developers.google.com/maps/documentation/javascript/get-api-key'),
570 'type' => \Elementor\Controls_Manager::TEXT,
571 'default' => '',
572 'condition' => [
573 'conf_custom_map_style' => ['google_map'],
574 ],
575 ]
576 );
577
578 $this->add_control(
579 'google_map_default_type',
580 [
581 'label' => __( 'Default Type', 'wpdirectorykit' ),
582 'type' => \Elementor\Controls_Manager::SELECT,
583 'default' => 'roadmap',
584 'options' => array(
585 'roadmap' => __( 'Roadmap', 'wpdirectorykit' ),
586 'aerial' => __( 'Aerial', 'wpdirectorykit' ),
587 'terrain' => __( 'Terrain', 'wpdirectorykit' ),
588 'hybrid' => __( 'Hybrid', 'wpdirectorykit' ),
589 'satellite' => __( 'Satellite', 'wpdirectorykit' ),
590 'traffic' => __( 'Traffic', 'wpdirectorykit' ),
591 'transit' => __( 'Transit', 'wpdirectorykit' ),
592 ),
593 'condition' => [
594 'conf_custom_map_style' => ['google_map'],
595 ],
596 ]
597 );
598
599 $this->add_control(
600 'conf_custom_map_style_self',
601 [
602 'label' => esc_html__('Link to custom Map Style', 'wpdirectorykit'),
603 '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' ),
604 'type' => Controls_Manager::TEXTAREA,
605 'render_type' => 'template',
606 'conditions' => [
607 'terms' => [
608 [
609 'name' => 'conf_custom_map_style',
610 'operator' => '==',
611 'value' => 'custom',
612 ]
613 ],
614 ]
615 ]
616 );
617
618 $this->end_controls_section();
619 }
620
621 $this->start_controls_section(
622 'conf_map_position',
623 [
624 'label' => esc_html__('Map Positioning', 'wpdirectorykit'),
625 'tab' => '1',
626 ]
627 );
628
629 $this->add_control(
630 'conf_custom_map_center_gps_lat',
631 [
632 'label' => esc_html__('GPS lat Center', 'wpdirectorykit'),
633 'type' => Controls_Manager::TEXT,
634 'default' => '45.675243',
635 ]
636 );
637
638 $this->add_control(
639 'conf_custom_map_center_gps_lng',
640 [
641 'label' => esc_html__('GPS lng Center', 'wpdirectorykit'),
642 'type' => Controls_Manager::TEXT,
643 'default' => '5.907848',
644 ]
645 );
646
647
648 $this->add_responsive_control(
649 'enable_custom_gps_center',
650 [
651 'label' => esc_html__( 'Enable custom GPS', 'wpdirectorykit' ),
652 'type' => Controls_Manager::SWITCHER,
653 'none' => esc_html__( 'True', 'wpdirectorykit' ),
654 'block' => esc_html__( 'False', 'wpdirectorykit' ),
655 'render_type' => 'template',
656 'return_value' => 'yes',
657 'default' => '',
658 ]
659 );
660
661 $this->end_controls_section();
662
663 }
664
665 private function generate_controls_layout() {
666
667 /* default marker layout */
668 $this->generate_controls_layout_default();
669 }
670
671 private function generate_controls_styles() {
672 /* default marker layout */
673 $this->generate_controls_styles_default();
674
675 /* marker */
676 $this->start_controls_section(
677 'styles_cluster',
678 [
679 'label' => esc_html__('Cluster', 'wpdirectorykit'),
680 'tab' => Controls_Manager::TAB_STYLE,
681 ]
682 );
683
684 $this->add_responsive_control(
685 'disable_cluster',
686 [
687 'label' => esc_html__( 'Disable Clusters', 'wpdirectorykit' ),
688 'type' => Controls_Manager::SWITCHER,
689 'none' => esc_html__( 'True', 'wpdirectorykit' ),
690 'block' => esc_html__( 'False', 'wpdirectorykit' ),
691 'render_type' => 'template',
692 'return_value' => 'yes',
693 'default' => '',
694 ]
695 );
696
697 $this->add_control(
698 'styles_cluster_color',
699 [
700 'label' => esc_html__('Cluster Color', 'wpdirectorykit'),
701 'type' => Controls_Manager::COLOR,
702 'selectors' => [
703 '{{WRAPPER}} .marker-cluster div' => 'background-color: {{VALUE}};',
704 ],
705 ]
706 );
707
708 $this->add_control(
709 'styles_cluster_color_border',
710 [
711 'label' => esc_html__('Cluster Color Border', 'wpdirectorykit'),
712 'type' => Controls_Manager::COLOR,
713 'selectors' => [
714 '{{WRAPPER}} .marker-cluster div::before' => 'border: 6px solid {{VALUE}}; box-shadow: inset 0 0 0 4px {{VALUE}};',
715 ],
716 ]
717 );
718
719 $this->add_control(
720 'styles_cluster_color_text',
721 [
722 'label' => esc_html__('Cluster Color Text', 'wpdirectorykit'),
723 'type' => Controls_Manager::COLOR,
724 'selectors' => [
725 '{{WRAPPER}} .marker-cluster div' => 'color: {{VALUE}};',
726 ],
727 ]
728 );
729
730 $this->add_group_control(
731 Group_Control_Typography::get_type(),
732 [
733 'name' => 'styles_cluster_color_font',
734 'selector' => '{{WRAPPER}} .marker-cluster div',
735 ]
736 );
737
738 $this->end_controls_section();
739
740 /* marker */
741 $this->start_controls_section(
742 'styles_marker_sec',
743 [
744 'label' => esc_html__('Marker', 'wpdirectorykit'),
745 'tab' => Controls_Manager::TAB_STYLE,
746 ]
747 );
748
749
750 $this->add_control(
751 'styles_marker_h',
752 [
753 'label' => esc_html__('Marker', 'wpdirectorykit'),
754 'type' => Controls_Manager::HEADING,
755 'separator' => 'before',
756 ]
757 );
758
759 $fields_data = wdk_cached_field_get();
760 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
761 $order_i = 0;
762
763 $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
764 $fields_list [(++$order_i).'__first_image'] = esc_html__('First Image', 'wpdirectorykit');
765 $fields_list [(++$order_i).'__counter_views'] = esc_html__('Views counter', 'wpdirectorykit');
766 $fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit');
767
768 $fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit');
769 $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit');
770 $fields_list [(++$order_i).'__category_title'] = esc_html__('Category', 'wpdirectorykit');
771 $fields_list [(++$order_i).'__location_title'] = esc_html__('Location', 'wpdirectorykit');
772
773 foreach($fields_data as $field)
774 {
775 if(wmvc_show_data('field_type', $field) == 'SECTION') {
776 $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --';
777 } else {
778 $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).']';
779 }
780 }
781
782 $this->add_control(
783 'custom_marker_fields',
784 [
785 'label' => __('Show field value instead of marker on map', 'wpdirectorykit'),
786 'type' => \Elementor\Controls_Manager::SELECT2,
787 'default' => '',
788 'label_block' => true,
789 'options' => $fields_list,
790 'separator' => 'after',
791 ]
792 );
793
794 $this->start_controls_tabs('marker_button_style');
795
796 $this->start_controls_tab(
797 'marker',
798 [
799 'label' => esc_html__('Normal', 'wpdirectorykit'),
800 ]
801 );
802
803 $this->add_control(
804 'styles_marker_color',
805 [
806 'label' => esc_html__('Marker Border Color', 'wpdirectorykit'),
807 'type' => Controls_Manager::COLOR,
808 'selectors' => [
809 '{{WRAPPER}} .wdk-element .wdk-map .wdk_marker-card::before' => 'background-color: {{VALUE}};',
810 '{{WRAPPER}} .wdk-element .wdk_marker-container.wdk_marker_label' => 'border-color: {{VALUE}};',
811 ],
812 ]
813 );
814
815 $this->add_control(
816 'styles_marker_color_bckg',
817 [
818 'label' => esc_html__('Marker Color', 'wpdirectorykit'),
819 'type' => Controls_Manager::COLOR,
820 'selectors' => [
821 '{{WRAPPER}} .wdk-element .wdk_marker-card:after' => 'background-color: {{VALUE}};',
822 '{{WRAPPER}} .wdk-element .wdk_marker-container.wdk_marker_label' => 'background-color: {{VALUE}};',
823 ],
824 ]
825 );
826
827 $this->add_control(
828 'styles_marker_color_text',
829 [
830 'label' => esc_html__('Marker Text Color', 'wpdirectorykit'),
831 'type' => Controls_Manager::COLOR,
832 'selectors' => [
833 '{{WRAPPER}} .wdk_face i' => 'color: {{VALUE}};',
834 '{{WRAPPER}} .wdk_marker-container.wdk_marker_label' => 'color: {{VALUE}};',
835 ],
836 ]
837 );
838
839 $this->add_control(
840 'conf_custom_map_pin_icon',
841 [
842 'label' => esc_html__('Icon', 'wpdirectorykit'),
843 'type' => Controls_Manager::ICONS,
844 'label_block' => true,
845 'default' => [
846 'value' => 'fa fa-home',
847 'library' => 'solid',
848 ],
849 'exclude_inline_options' => array('svg'),
850 ]
851 );
852
853 $this->add_control(
854 'conf_custom_map_pin',
855 [
856 'label' => esc_html__('Custom Marker Pin Image', 'wpdirectorykit'),
857 'type' => Controls_Manager::MEDIA,
858 ]
859 );
860
861 $this->end_controls_tab();
862
863 $this->start_controls_tab(
864 'marker_hover',
865 [
866 'label' => esc_html__('Hover', 'wpdirectorykit'),
867 ]
868 );
869
870 $this->add_control(
871 'styles_marker_color_hover',
872 [
873 'label' => esc_html__('Marker Border Color', 'wpdirectorykit'),
874 'type' => Controls_Manager::COLOR,
875 'selectors' => [
876 '{{WRAPPER}} .wdk-element .wdk_marker-container:hover .wdk_marker-card:before' => 'background-color: {{VALUE}};',
877 '{{WRAPPER}} .wdk-element .wdk_marker-container.wdk_marker_label:hover' => 'border-color: {{VALUE}};',
878 ],
879 ]
880 );
881
882 $this->add_control(
883 'styles_marker_color_hover_bckg',
884 [
885 'label' => esc_html__('Marker Color', 'wpdirectorykit'),
886 'type' => Controls_Manager::COLOR,
887 'selectors' => [
888 '{{WRAPPER}} .wdk-element .wdk_marker-container:hover .wdk_marker-card:after' => 'background-color: {{VALUE}};',
889 '{{WRAPPER}} .wdk-element .wdk_marker-container.wdk_marker_label:hover' => 'background-color: {{VALUE}};',
890 ],
891 ]
892 );
893
894 $this->add_control(
895 'styles_marker_color_text_hover',
896 [
897 'label' => esc_html__('Marker Text Color', 'wpdirectorykit'),
898 'type' => Controls_Manager::COLOR,
899 'selectors' => [
900 '{{WRAPPER}} .wdk_marker-container:hover .wdk_face.back i, .wdk_marker-container:hover .wdk_face i' => 'color: {{VALUE}};',
901 '{{WRAPPER}} .wdk_marker-container.wdk_marker_label:hover' => 'color: {{VALUE}};',
902 ],
903 ]
904 );
905
906 $this->add_control(
907 'styles_marker_effect_duration',
908 [
909 'label' => esc_html__('Transition Duration', 'wpdirectorykit'),
910 'type' => Controls_Manager::SLIDER,
911 'render_type' => 'template',
912 'range' => [
913 'px' => [
914 'min' => 0,
915 'max' => 3000,
916 ],
917 ],
918 'selectors' => [
919 '{{WRAPPER}} .wdk_map-marker-container.clicked .wdk_face.front, .wdk_marker-container:hover .wdk_face.front' => 'transition-duration: {{SIZE}}ms',
920 '{{WRAPPER}} .wdk_marker-container.wdk_marker_label' => 'transition-duration: {{SIZE}}ms',
921 ],
922 ]
923 );
924
925 $this->end_controls_tab();
926
927 $this->end_controls_tabs();
928 $this->end_controls_section();
929
930
931
932
933 }
934
935 private function generate_controls_content() {
936 /* default marker layout */
937 $this->generate_controls_content_default();
938 }
939
940 private function generate_controls_layout_default() {
941
942 }
943
944 private function generate_controls_styles_default() {
945 $this->start_controls_section(
946 'styles_thmbn_section',
947 [
948 'label' => esc_html__('Section Image', 'wpdirectorykit'),
949 'tab' => Controls_Manager::TAB_STYLE,
950 ]
951 );
952
953 $this->add_responsive_control(
954 'styles_thmbn_des_type',
955 [
956 'label' => __( 'Design type', 'wpdirectorykit' ),
957 'type' => \Elementor\Controls_Manager::SELECT,
958 'default' => 'wdk_size_image_cover',
959 'options' => [
960 '' => __( 'Default Sizes', 'wpdirectorykit' ),
961 'wdk_size_image_cover' => __( 'Image auto crop/resize', 'wpdirectorykit' ),
962 ],
963 ]
964 );
965
966 $this->add_responsive_control(
967 'styles_thmbn_des_height',
968 [
969 'label' => esc_html__('Height', 'wpdirectorykit'),
970 'type' => Controls_Manager::SLIDER,
971 'range' => [
972 'px' => [
973 'min' => 50,
974 'max' => 1500,
975 ],
976 ],
977 'render_type' => 'ui',
978 'default' => [
979 'size' => 350,
980 ],
981 'selectors' => [
982 '{{WRAPPER}} .wdk_size_image_cover .wdk-listing-card .wdk-thumbnail .wdk-image' => 'height: {{SIZE}}px',
983 ],
984 'separator' => 'after',
985 'conditions' => [
986 'relation' => 'or',
987 'terms' => [
988 [
989 'name' => 'styles_thmbn_des_type',
990 'operator' => '==',
991 'value' => 'wdk_size_image_cover',
992 ],
993 [
994 'name' => 'styles_thmbn_des_type',
995 'operator' => '==',
996 'value' => 'wdk_image_cover',
997 ]
998 ],
999 ]
1000 ]
1001 );
1002 $this->end_controls_section();
1003 }
1004
1005 private function generate_controls_content_default() {
1006 $this->start_controls_section(
1007 'content_thumbnail_section',
1008 [
1009 'label' => esc_html__('Colors', 'wpdirectorykit'),
1010 'tab' => 'tab_layout',
1011 ]
1012 );
1013
1014 $this->add_control(
1015 'content_thumbnail_section_header',
1016 [
1017 'label' => esc_html__('Color Hover Thumbnail', 'wpdirectorykit'),
1018 'type' => Controls_Manager::HEADING,
1019 ]
1020 );
1021
1022 $this->add_responsive_control(
1023 'content_thumbnail_section_d_background',
1024 [
1025 'label' => esc_html__( 'Color', 'wpdirectorykit' ),
1026 'description' => esc_html__( 'Set some opacity for color', 'wpdirectorykit' ),
1027 'type' => Controls_Manager::COLOR,
1028 'selectors' => [
1029 '{{WRAPPER}} .wdk-listing-card .wdk-thumbnail::before, {{WRAPPER}} .wdk-listing-card .wdk-thumbnail::after,{{WRAPPER}} .wdk-listing-card .overlay' => 'background-color: {{VALUE}};',
1030 ],
1031 ]
1032 );
1033
1034 $this->add_control(
1035 'content_thumbnail_section_header_f',
1036 [
1037 'label' => esc_html__('Shadow around Card, for Featured Listings', 'wpdirectorykit'),
1038 'type' => Controls_Manager::HEADING,
1039 ]
1040 );
1041
1042 $this->add_group_control(
1043 Group_Control_Box_Shadow::get_type(),
1044 [
1045 'name' => 'content_thumbnail_section_d_featured',
1046 'exclude' => [
1047 'field_shadow_position',
1048 ],
1049 'selector' => '{{WRAPPER}} .wdk-listing-card.is_featured',
1050 ]
1051 );
1052 $this->end_controls_section();
1053
1054 $items = [
1055 [
1056 'key'=>'content_label',
1057 'label'=> esc_html__('Over Image Top', 'wpdirectorykit'),
1058 'selector'=>'.wdk-element .wdk-listing-card .wdk-thumbnail .wdk-over-image-top span',
1059 'options'=>'full',
1060 ],
1061 [
1062 'key'=>'content_type',
1063 'label'=> esc_html__('Over Image Bottom', 'wpdirectorykit'),
1064 'selector'=>'.wdk-element .wdk-listing-card .wdk-thumbnail .wdk-over-image-bottom',
1065 'is_featured'=>'.wdk-element .wdk-listing-card.is_featured .wdk-thumbnail .wdk-over-image-bottom',
1066 'options'=>'full',
1067 ],
1068 [
1069 'key'=>'content_title',
1070 'label'=> esc_html__('Title Part', 'wpdirectorykit'),
1071 'selector'=>'.wdk-element .wdk-listing-card .wdk-title .title',
1072 'options'=>'full',
1073 ],
1074 [
1075 'key'=>'content_description',
1076 'label'=> esc_html__('Subtitle part', 'wpdirectorykit'),
1077 'selector'=>'.wdk-element .wdk-listing-card .wdk-subtitle-part',
1078 'options'=>'full',
1079 ],
1080 [
1081 'key'=>'content_items',
1082 'label'=> esc_html__('Features part', 'wpdirectorykit'),
1083 'selector'=>'.wdk-element .wdk-listing-card .wdk-features-part span',
1084 'options'=>'full',
1085 ],
1086 [
1087 'key'=>'wdk-divider',
1088 'label'=> esc_html__('Divider', 'wpdirectorykit'),
1089 'selector'=>'.wdk-element .wdk-listing-card .wdk-divider',
1090 'options'=>'full',
1091 ],
1092 [
1093 'key'=>'content_price',
1094 'label'=> esc_html__('Pricing part', 'wpdirectorykit'),
1095 'selector'=>'.wdk-element .wdk-listing-card .wdk-footer .wdk-price',
1096 'options'=>'full',
1097 ],
1098 [
1099 'key'=>'content_button',
1100 'label'=> esc_html__('Button Open', 'wpdirectorykit'),
1101 'selector'=>'.wdk-element .wdk-listing-card .wdk-footer .wdk-btn',
1102 'options'=>'full',
1103 ],
1104 [
1105 'key'=>'content_card',
1106 'label'=> esc_html__('Card', 'wpdirectorykit'),
1107 'selector'=>'.wdk-element .wdk-listing-card',
1108 'options'=>'full',
1109 ],
1110 ];
1111
1112 foreach ($items as $item) {
1113
1114 $this->start_controls_section(
1115 $item['key'].'_section',
1116 [
1117 'label' => $item['label'],
1118 'tab' => 'tab_layout'
1119 ]
1120 );
1121 if($item['key']!='content_card')
1122 $this->add_responsive_control(
1123 $item['key'].'_hide',
1124 [
1125 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ),
1126 'type' => Controls_Manager::SWITCHER,
1127 'none' => esc_html__( 'Hide', 'wpdirectorykit' ),
1128 'block' => esc_html__( 'Show', 'wpdirectorykit' ),
1129 'return_value' => 'none',
1130 'default' => '',
1131 'selectors' => [
1132 '{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};',
1133 ],
1134 ]
1135 );
1136 $selectors = array(
1137 'normal' => '{{WRAPPER}} '.$item['selector'],
1138 'hover'=>'{{WRAPPER}} '.$item['selector'].'%1$s'
1139 );
1140
1141 if(isset($item['is_featured'])) {
1142 $selectors['featured'] = '{{WRAPPER}} '.$item['is_featured'];
1143 }
1144 $this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']);
1145
1146
1147
1148 /* special for some elements */
1149
1150 if($item['key'] == 'content_items') {
1151 $this->add_control(
1152 $item['key'].'_parent_head',
1153 [
1154 'label' => esc_html__('Parent Box', 'wpdirectorykit'),
1155 'type' => Controls_Manager::HEADING,
1156 'separator' => 'before',
1157 ]
1158 );
1159
1160 $selectors = array(
1161 'normal' => '{{WRAPPER}} .wdk-element .wdk-listing-card .wdk-features-part',
1162 );
1163 $this->generate_renders_tabs($selectors, $item['key'].'_parent_dynamic', ['margin','align']);
1164 }
1165
1166 if ($item['key'] == 'content_description') {
1167
1168 $this->add_control(
1169 'content_description_limit',
1170 [
1171 'label' => __( 'Limit Line (per field)', 'wpdirectorykit' ),
1172 'type' => \Elementor\Controls_Manager::NUMBER,
1173 'min' => 1,
1174 'max' => 10,
1175 'step' => 1,
1176 'default' => 3,
1177 'selectors' => [
1178 '{{WRAPPER}} .wdk-listing-card .wdk-subtitle-part span' => '-webkit-line-clamp: {{VALUE}};',
1179 ],
1180 ]
1181 );
1182
1183 }
1184
1185 if($item['key'] == 'content_button' && FALSE) {
1186 $this->add_control(
1187 $item['key'].'_icon',
1188 [
1189 'label' => esc_html__('Icon', 'wpdirectorykit'),
1190 'type' => Controls_Manager::ICONS,
1191 'label_block' => true,
1192 'default' => [
1193 'value' => 'fa fa-angle-right',
1194 'library' => 'solid',
1195 ],
1196 ]
1197 );
1198 $this->add_responsive_control(
1199 $item['key'].'_text',
1200 [
1201 'label' => __( 'Text of Link', 'wpdirectorykit' ),
1202 'type' => \Elementor\Controls_Manager::TEXT,
1203 'default' => '',
1204 ]
1205 );
1206
1207 $selectors = array(
1208 'normal' => '{{WRAPPER}} '.$item['selector'].' i',
1209 );
1210 $this->generate_renders_tabs($selectors, $item['key'].'_icon_dynamic', ['margin']);
1211 }
1212
1213 if($item['key'] == 'content_label') {
1214 $this->add_responsive_control(
1215 $item['key'] .'content_label_positions_y',
1216 [
1217 'label' => __( 'Position Y', 'wpdirectorykit' ),
1218 'type' => Controls_Manager::CHOOSE,
1219 'options' => [
1220 'top' => [
1221 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
1222 'icon' => 'eicon-text-align-top',
1223 ],
1224 'center' => [
1225 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1226 'icon' => 'eicon-text-align-center',
1227 ],
1228 'bottom' => [
1229 'title' => esc_html__( 'Bottom', 'wpdirectorykit' ),
1230 'icon' => 'eicon-text-align-bottom',
1231 ],
1232 ],
1233 'default' => 'left',
1234 'render_type' => 'ui',
1235 'selectors_dictionary' => [
1236 'top' => 'top:0;bottom:initial',
1237 'center' => 'top:50%;transform: translateY(-50%)',
1238 'bottom' => 'top:initial;bottom:0',
1239 ],
1240 'selectors' => [
1241 '{{WRAPPER}} .wdk-listing-card .wdk-thumbnail .wdk-over-image-top' => '{{VALUE}};',
1242 ],
1243 ]
1244 );
1245
1246 $this->add_responsive_control(
1247 $item['key'] .'content_label_positions_x',
1248 [
1249 'label' => __( 'Position X', 'wpdirectorykit' ),
1250 'type' => Controls_Manager::CHOOSE,
1251 'options' => [
1252 'left' => [
1253 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1254 'icon' => 'eicon-text-align-left',
1255 ],
1256 'center' => [
1257 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1258 'icon' => 'eicon-text-align-center',
1259 ],
1260 'right' => [
1261 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1262 'icon' => 'eicon-text-align-right',
1263 ],
1264 ],
1265 'default' => 'left',
1266 'render_type' => 'ui',
1267 'selectors_dictionary' => [
1268 'left' => 'left:0',
1269 'center' => 'left:50%;transform: translateX(-50%)',
1270 'right' => 'left:initial; right:0',
1271 ],
1272 'selectors' => [
1273 '{{WRAPPER}} .wdk-listing-card .wdk-thumbnail .wdk-over-image-top' => '{{VALUE}};',
1274 ],
1275 ]
1276 );
1277 }
1278
1279 if($item['key'] == 'content_type') {
1280 $this->add_responsive_control(
1281 $item['key'] .'content_label_positions_y',
1282 [
1283 'label' => __( 'Position Y', 'wpdirectorykit' ),
1284 'type' => Controls_Manager::CHOOSE,
1285 'options' => [
1286 'top' => [
1287 'title' => esc_html__( 'Top', 'wpdirectorykit' ),
1288 'icon' => 'eicon-text-align-top',
1289 ],
1290 'center' => [
1291 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1292 'icon' => 'eicon-text-align-center',
1293 ],
1294 'bottom' => [
1295 'title' => esc_html__( 'Bottom', 'wpdirectorykit' ),
1296 'icon' => 'eicon-text-align-bottom',
1297 ],
1298 ],
1299 'default' => 'left',
1300 'render_type' => 'ui',
1301 'selectors_dictionary' => [
1302 'top' => 'top:0;bottom:initial',
1303 'center' => 'top:50%;transform: translateY(-50%)',
1304 'bottom' => 'top:initial;bottom:0',
1305 ],
1306 'selectors' => [
1307 '{{WRAPPER}} '.$item['selector'] => '{{VALUE}};',
1308 ],
1309 ]
1310 );
1311
1312 $this->add_responsive_control(
1313 $item['key'] .'content_label_positions_x',
1314 [
1315 'label' => __( 'Position X', 'wpdirectorykit' ),
1316 'type' => Controls_Manager::CHOOSE,
1317 'options' => [
1318 'left' => [
1319 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
1320 'icon' => 'eicon-text-align-left',
1321 ],
1322 'center' => [
1323 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
1324 'icon' => 'eicon-text-align-center',
1325 ],
1326 'right' => [
1327 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
1328 'icon' => 'eicon-text-align-right',
1329 ],
1330 'justify' => [
1331 'title' => esc_html__( 'Justified', 'wpdirectorykit' ),
1332 'icon' => 'eicon-text-align-justify',
1333 ],
1334 ],
1335 'default' => 'left',
1336 'render_type' => 'ui',
1337 'selectors_dictionary' => [
1338 'top' => 'justify-content: flex-start;',
1339 'center' => 'justify-content: center;',
1340 'bottom' => 'justify-content: flex-end;',
1341 'justify' => 'justify-content: stretch;',
1342 ],
1343 'selectors' => [
1344 '{{WRAPPER}} '.$item['selector'] => '{{VALUE}};',
1345 ],
1346 ]
1347 );
1348 }
1349 $this->end_controls_section();
1350 /* END special for some elements */
1351 }
1352 }
1353
1354
1355 public function enqueue_styles_scripts() {
1356 wp_enqueue_style('leaflet');
1357 wp_enqueue_style('leaflet-cluster-def');
1358 wp_enqueue_style('leaflet-cluster');
1359 wp_enqueue_script('leaflet');
1360 wp_enqueue_script('leaflet-cluster');
1361 wp_enqueue_script('leaflet-fullscreen');
1362 wp_enqueue_style('leaflet-fullscreen');
1363
1364 wp_enqueue_style('wdk-notify');
1365 wp_enqueue_script('wdk-notify');
1366 wp_enqueue_style( 'wdk-listings-map' );
1367
1368
1369 wp_enqueue_style('slick');
1370 wp_enqueue_style('slick-theme');
1371 wp_enqueue_style('wdk-hover');
1372 wp_enqueue_script('slick');
1373 wp_enqueue_script('leaflet-googlemutant');
1374
1375 wp_enqueue_style('leaflet-draw');
1376 wp_enqueue_script('wdk-map-rectangle');
1377
1378 if( wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')) {
1379 wp_enqueue_script( 'wdk-ajax-loading-listings');
1380 }
1381 }
1382
1383 }
1384