| @@ -7,9 +7,8 @@ | ||
| 7 | 7 | |
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | 9 | exit; // Exit if accessed directly. |
| 10 | 10 | } |
| 11 | - | |
| 12 | 11 | ?> |
| 13 | 12 | |
| 14 | 13 | <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>"> |
| 15 | 14 | <div class="wdk-map" class="wdk_map_results"> |
| @@ -27,9 +26,9 @@ | ||
| 27 | 26 | $post_id = $wdk_listing_page_id; |
| 28 | 27 | ?> |
| 29 | 28 | data-el_page_id="<?php echo esc_attr($post_id);?>" |
| 30 | 29 | |
| 31 | - class="wdk_map_results <?php echo wmvc_show_data('styles_thmbn_des_type',$settings, '');?> | |
| 30 | + class="wdk_map_results <?php echo esc_attr(wmvc_show_data('styles_thmbn_des_type',$settings, ''));?> | |
| 32 | 31 | <?php if |
| 33 | 32 | ( |
| 34 | 33 | wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results') && |
| 35 | 34 | isset($settings['is_ajax_enable']) && $settings['is_ajax_enable'] == 'yes' |
| @@ -38,10 +37,10 @@ | ||
| 38 | 37 | <?php endif;?> |
| 39 | 38 | " > |
| 40 | 39 | </div> |
| 41 | 40 | <form action="" class="wdk-search-form map" style="wdk-hidden"> |
| 42 | - <input name="rectangle_ne" type="hidden" class="wdk-hidden" value="<?php echo isset($_GET['rectangle_ne']) ? esc_attr(sanitize_text_field($_GET['rectangle_ne'])) : '';?>"/> | |
| 43 | - <input name="rectangle_sw" type="hidden" class="wdk-hidden" value="<?php echo isset($_GET['rectangle_sw']) ? esc_attr(sanitize_text_field($_GET['rectangle_sw'])) : '';?>"/> | |
| 41 | + <input name="rectangle_ne" type="hidden" class="wdk-hidden" value="<?php echo isset($_GET['rectangle_ne']) ? esc_attr(sanitize_text_field(wp_unslash($_GET['rectangle_ne']))) : '';?>"/> | |
| 42 | + <input name="rectangle_sw" type="hidden" class="wdk-hidden" value="<?php echo isset($_GET['rectangle_sw']) ? esc_attr(sanitize_text_field(wp_unslash($_GET['rectangle_sw']))) : '';?>"/> | |
| 44 | 43 | </form> |
| 45 | 44 | </div> |
| 46 | 45 | </div> |
| 47 | 46 | <?php |
| @@ -56,8 +55,9 @@ | ||
| 56 | 55 | ?> |
| 57 | 56 | <?php |
| 58 | 57 | $WMVC = &wdk_get_instance(); |
| 59 | 58 | $WMVC->model('category_m'); |
| 59 | + | |
| 60 | 60 | if (!$is_edit_mode) |
| 61 | 61 | ob_start(); |
| 62 | 62 | ?> |
| 63 | 63 | <script> |
| @@ -112,9 +112,9 @@ | ||
| 112 | 112 | |
| 113 | 113 | // define rectangle geographical bounds |
| 114 | 114 | <?php if(isset($_GET['rectangle_ne']) && isset($_GET['rectangle_sw'])) :?> |
| 115 | 115 | <?php if(wdk_is_gps($_GET['rectangle_ne']) && wdk_is_gps($_GET['rectangle_sw'])) :?> |
| 116 | - var bounds = [[<?php echo isset($_GET['rectangle_ne']) ? esc_attr(sanitize_text_field($_GET['rectangle_ne'])) : '';?>], [<?php echo isset($_GET['rectangle_sw']) ? esc_attr(sanitize_text_field($_GET['rectangle_sw'])) : '';?>]]; | |
| 116 | + var bounds = [[<?php echo isset($_GET['rectangle_ne']) ? esc_attr(sanitize_text_field(wp_unslash($_GET['rectangle_ne']))) : '';?>], [<?php echo isset($_GET['rectangle_sw']) ? esc_attr(sanitize_text_field(wp_unslash($_GET['rectangle_sw']))) : '';?>]]; | |
| 117 | 117 | drawMap.drawOuther(bounds); |
| 118 | 118 | <?php endif;?> |
| 119 | 119 | <?php endif;?> |
| 120 | 120 | <?php endif;?> |
| @@ -217,8 +217,25 @@ | ||
| 217 | 217 | } |
| 218 | 218 | ).addTo(wdk_map); |
| 219 | 219 | |
| 220 | 220 | <?php elseif(in_array($settings['conf_custom_map_style'], array( |
| 221 | + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png', | |
| 222 | + 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', | |
| 223 | + 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png', | |
| 224 | + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png', | |
| 225 | + ))):?> | |
| 226 | + | |
| 227 | + <?php | |
| 228 | + // If no Carto key is provided, show default tile styling (fallback to OSM) | |
| 229 | + if (!$is_edit_mode && empty($settings['carto_map_key'])): ?> | |
| 230 | + var positron = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
| 231 | + attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | |
| 232 | + }).addTo(wdk_map); | |
| 233 | + <?php else: ?> | |
| 234 | + var positron = L.tileLayer('<?php echo esc_js($settings['conf_custom_map_style']);?>?key=<?php echo esc_js($settings['carto_map_key']);?>').addTo(wdk_map); | |
| 235 | + <?php endif; ?> | |
| 236 | + | |
| 237 | + <?php elseif(in_array($settings['conf_custom_map_style'], array( | |
| 221 | 238 | 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png', |
| 222 | 239 | 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png', |
| 223 | 240 | 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png', |
| 224 | 241 | 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png', |
| @@ -300,15 +317,15 @@ | ||
| 300 | 317 | |
| 301 | 318 | $field_value .= apply_filters( 'wpdirectorykit/listing/field/suffix',wdk_field_option ($field_id, 'suffix'), $field_id); |
| 302 | 319 | ?> |
| 303 | 320 | auto_marker_size = true; |
| 304 | - var innerMarker = '<div class="wdk_marker-container wdk_marker_label category_id_<?php echo esc_js(wmvc_show_data('category_id', $listing));?>"><?php echo esc_js(strip_tags($field_value));?></div>'; | |
| 321 | + var innerMarker = '<div class="wdk_marker-container wdk_marker_label category_id_<?php echo esc_js(wmvc_show_data('category_id', $listing));?>"><?php echo esc_js(wp_strip_all_tags($field_value));?></div>'; | |
| 305 | 322 | <?php elseif($pin_icon):?> |
| 306 | 323 | var image = '<?php echo esc_html($pin_icon);?>'; var innerMarker = '<div class="wdk_marker-container wdk_marker-container-image"><img src='+image+'></img></div>'; |
| 307 | 324 | <?php elseif($font_icon && empty($font_class)):?> |
| 308 | - var innerMarker = '<div class="wdk_marker-container category_id_<?php echo esc_js(wmvc_show_data('category_id', $listing));?>"><div class="front wdk_face"><?php echo wdk_viewe($font_icon);?></div><div class="wdk_marker-card"><div class="wdk_marker-arrow"></div></div></div>'; | |
| 325 | + var innerMarker = '<div class="wdk_marker-container category_id_<?php echo esc_js(wmvc_show_data('category_id', $listing));?>"><div class="front wdk_face"><?php echo wdk_viewe($font_icon);// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText?></div><div class="wdk_marker-card"><div class="wdk_marker-arrow"></div></div></div>'; | |
| 309 | 326 | <?php else:?> |
| 310 | - var innerMarker = '<div class="wdk_marker-container category_id_<?php echo esc_js(wmvc_show_data('category_id', $listing));?>"><div class="front wdk_face"><i class="<?php echo esc_html($font_class);?>"></i></div><div class="wdk_marker-card"><div class="wdk_marker-arrow"></div></div></div>'; | |
| 327 | + var innerMarker = '<div class="wdk_marker-container category_id_<?php echo esc_js(wmvc_show_data('category_id', $listing));?>"><div class="front wdk_face"><i class="<?php echo esc_attr($font_class);?>"></i></div><div class="wdk_marker-card"><div class="wdk_marker-arrow"></div></div></div>'; | |
| 311 | 328 | <?php endif;?> |
| 312 | 329 | |
| 313 | 330 | wdk_markers.push(wdk_generate_marker_ajax_popup('<?php echo esc_url(admin_url('admin-ajax.php'));?>','<?php echo esc_html(wmvc_show_data('post_id', $listing));?>','<?php echo esc_html($listing_lat);?>','<?php echo esc_html($listing_lng);?>',innerMarker, wdk_jpopup_customOptions, auto_marker_size |
| 314 | 331 | , <?php if(wmvc_show_data('disable_cluster', $settings) == 'yes'):?> false<?php else:?> true <?php endif;?> <?php if(wmvc_show_data('custom_layout_id', $settings)):?>, <?php echo esc_js(wmvc_show_data('custom_layout_id', $settings));?> <?php endif;?>)); |