|
@@ -64,7 +64,7 @@ discard block |
|
|
block discarded – undo |
|
64
|
64
|
$title = str_replace($srcharr, $replarr, $post_title);
|
|
65
|
65
|
|
|
66
|
66
|
if (is_ssl()) {
|
|
67
|
|
- $icon = str_replace("http:","https:",$icon );
|
|
|
67
|
+ $icon = str_replace("http:", "https:", $icon);
|
|
68
|
68
|
}
|
|
69
|
69
|
|
|
70
|
70
|
if ($icon != '') {
|
|
@@ -80,7 +80,7 @@ discard block |
|
|
block discarded – undo |
|
80
|
80
|
$icon_size = array('w' => 36, 'h' => 45);
|
|
81
|
81
|
}
|
|
82
|
82
|
|
|
83
|
|
- $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
|
|
|
83
|
+ $post_json = '{"id":"'.$post->ID.'","t": "'.$title.'","lt": "'.$post->post_latitude.'","ln": "'.$post->post_longitude.'","mk_id":"'.$post->ID.'_'.$post->default_category.'","i":"'.$icon.'","w":"'.$icon_size['w'].'","h":"'.$icon_size['h'].'"}';
|
|
84
|
84
|
|
|
85
|
85
|
/**
|
|
86
|
86
|
* Filter the json data when creating output for post json marker..
|
|
@@ -89,7 +89,7 @@ discard block |
|
|
block discarded – undo |
|
89
|
89
|
* @param string $post_json JSON representation of the post marker info.
|
|
90
|
90
|
* @param object $post The post object.
|
|
91
|
91
|
*/
|
|
92
|
|
- $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
|
|
|
92
|
+ $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post);
|
|
93
|
93
|
}
|
|
94
|
94
|
}
|
|
95
|
95
|
|
|
@@ -110,16 +110,16 @@ discard block |
|
|
block discarded – undo |
|
110
|
110
|
if (is_array($map_jason) && !empty($map_jason)) {
|
|
111
|
111
|
if ($canvas == 'detail_page_map_canvas') {
|
|
112
|
112
|
global $post;
|
|
113
|
|
- foreach($map_jason as $key => $content)
|
|
|
113
|
+ foreach ($map_jason as $key => $content)
|
|
114
|
114
|
{
|
|
115
|
115
|
$content = json_decode($content);
|
|
116
|
|
- if ( $content->id != $post->ID ) {
|
|
|
116
|
+ if ($content->id != $post->ID) {
|
|
117
|
117
|
unset($map_jason[$key]);
|
|
118
|
118
|
}
|
|
119
|
119
|
}
|
|
120
|
120
|
|
|
121
|
121
|
}
|
|
122
|
|
- $canvas_jason = $canvas . "_jason";
|
|
|
122
|
+ $canvas_jason = $canvas."_jason";
|
|
123
|
123
|
$map_canvas_arr[$canvas] = array_unique($map_jason);
|
|
124
|
124
|
unset($cat_content_info);
|
|
125
|
125
|
$cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
|
|
@@ -127,12 +127,12 @@ discard block |
|
|
block discarded – undo |
|
127
|
127
|
if (!empty($cat_content_info)) {
|
|
128
|
128
|
$json_content = substr(implode(',', $cat_content_info), 1);
|
|
129
|
129
|
$json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
|
|
130
|
|
- $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
|
|
|
130
|
+ $canvas_jason = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
|
|
131
|
131
|
} else {
|
|
132
|
132
|
$canvas_jason = '[{"totalcount":"0"}]';
|
|
133
|
133
|
}
|
|
134
|
134
|
|
|
135
|
|
- $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
|
|
|
135
|
+ $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
|
|
136
|
136
|
|
|
137
|
137
|
/**
|
|
138
|
138
|
* Filter the send_marker_jason_to_js() function map canvas json args.
|
|
@@ -144,12 +144,12 @@ discard block |
|
|
block discarded – undo |
|
144
|
144
|
* @param string $canvas Map canvas array key.
|
|
145
|
145
|
* @param array $map_canvas_jason_args Map canvas args.
|
|
146
|
146
|
*/
|
|
147
|
|
- $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
|
|
|
147
|
+ $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
|
|
148
|
148
|
|
|
149
|
|
- wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
|
|
|
149
|
+ wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
|
|
150
|
150
|
} else {
|
|
151
|
151
|
$canvas_jason = '[{"totalcount":"0"}]';
|
|
152
|
|
- $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
|
|
|
152
|
+ $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
|
|
153
|
153
|
|
|
154
|
154
|
/**
|
|
155
|
155
|
* Filter the send_marker_jason_to_js() function map canvas json args.
|
|
@@ -161,8 +161,8 @@ discard block |
|
|
block discarded – undo |
|
161
|
161
|
* @param string $canvas Map canvas array key.
|
|
162
|
162
|
* @param array $map_canvas_jason_args Map canvas args.
|
|
163
|
163
|
*/
|
|
164
|
|
- $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
|
|
165
|
|
- wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
|
|
|
164
|
+ $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
|
|
|
165
|
+ wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
|
|
166
|
166
|
}
|
|
167
|
167
|
}
|
|
168
|
168
|
|
|
@@ -224,7 +224,7 @@ discard block |
|
|
block discarded – undo |
|
224
|
224
|
}
|
|
225
|
225
|
|
|
226
|
226
|
|
|
227
|
|
- $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
|
|
|
227
|
+ $out = '<ul class="treeview '.$list_class.'" style="margin-left:'.$p.'px;'.$display.';">';
|
|
228
|
228
|
|
|
229
|
229
|
$geodir_cat_icons = geodir_get_term_icon();
|
|
230
|
230
|
|
|
@@ -240,16 +240,16 @@ discard block |
|
|
block discarded – undo |
|
240
|
240
|
|
|
241
|
241
|
// Untick the category by default on home map
|
|
242
|
242
|
if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
|
|
243
|
|
- if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
|
|
|
243
|
+ if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$cat_term->term_id, $geodir_home_map_untick)) {
|
|
244
|
244
|
$checked = '';
|
|
245
|
245
|
}
|
|
246
|
246
|
}
|
|
247
|
247
|
|
|
248
|
|
- $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
|
|
249
|
|
- $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
|
|
250
|
|
- $term_check .= ' title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
|
|
251
|
|
- $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
|
|
252
|
|
- $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
|
|
|
248
|
+ $term_check = '<input type="checkbox" '.$checked.' id="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'" class="group_selector '.$main_list_class.'"';
|
|
|
249
|
+ $term_check .= ' name="'.$map_canvas_name.'_cat[]" ';
|
|
|
250
|
+ $term_check .= ' title="'.esc_attr(ucfirst($cat_term->name)).'" value="'.$cat_term->term_id.'" onclick="javascript:build_map_ajax_search_param(\''.$map_canvas_name.'\',false, this)">';
|
|
|
251
|
+ $term_img = '<img height="15" width="15" alt="'.$cat_term->taxonomy.'" src="'.$icon.'" title="'.ucfirst($cat_term->name).'"/>';
|
|
|
252
|
+ $out .= '<li>'.$term_check.'<label for="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'">'.$term_img.ucfirst($cat_term->name).'</label><i class="fa fa-long-arrow-down"></i>';
|
|
253
|
253
|
|
|
254
|
254
|
endif;
|
|
255
|
255
|
|
|
@@ -361,11 +361,11 @@ discard block |
|
|
block discarded – undo |
|
361
|
361
|
* @package GeoDirectory
|
|
362
|
362
|
*/
|
|
363
|
363
|
function geodir_map_load_style() {
|
|
364
|
|
- if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
|
|
|
364
|
+ if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) {
|
|
365
|
365
|
?>
|
|
366
|
366
|
<script type="text/javascript">
|
|
367
|
367
|
if (!(window.google && typeof google.maps !== 'undefined')) {
|
|
368
|
|
- document.write('<' + 'link id="geodirectory-leaflet-style-css" media="all" type="text/css" href="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION;?>" rel="stylesheet"' + '>');
|
|
|
368
|
+ document.write('<' + 'link id="geodirectory-leaflet-style-css" media="all" type="text/css" href="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION; ?>" rel="stylesheet"' + '>');
|
|
369
|
369
|
}
|
|
370
|
370
|
</script>
|
|
371
|
371
|
<?php
|
|
@@ -381,12 +381,12 @@ discard block |
|
|
block discarded – undo |
|
381
|
381
|
* @package GeoDirectory
|
|
382
|
382
|
*/
|
|
383
|
383
|
function geodir_map_load_script() {
|
|
384
|
|
- if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
|
|
|
384
|
+ if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) {
|
|
385
|
385
|
?>
|
|
386
|
386
|
<script type="text/javascript">
|
|
387
|
387
|
if (!(window.google && typeof google.maps !== 'undefined')) {
|
|
388
|
|
- document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
|
|
389
|
|
- document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
|
|
|
388
|
+ document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
|
|
|
389
|
+ document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
|
|
390
|
390
|
}
|
|
391
|
391
|
</script>
|
|
392
|
392
|
<?php
|