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

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

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