Test Failed
Push — master ( ab062a...8d9d5e )
by
unknown
19:09
created
geodirectory-functions/map-functions/map_functions.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') {
56 56
 
57
-        if(isset($map_jason[$post->ID])){return null;}
57
+        if (isset($map_jason[$post->ID])) {return null; }
58 58
 
59 59
         $srcharr = array("'", "/", "-", '"', '\\');
60 60
         $replarr = array("′", "⁄", "–", "“", '');
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $title = str_replace($srcharr, $replarr, $post_title);
68 68
 
69 69
         if (is_ssl()) {
70
-            $icon = str_replace("http:","https:",$icon );
70
+            $icon = str_replace("http:", "https:", $icon);
71 71
         }
72 72
         
73 73
         if ($icon != '') {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $icon_size = array('w' => 36, 'h' => 45);
84 84
         }
85 85
 
86
-        $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'] . '"}';
86
+        $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'].'"}';
87 87
 
88 88
         /**
89 89
          * Filter the json data when creating output for post json marker..
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
          * @param string $post_json JSON representation of the post marker info.
93 93
          * @param object $post The post object.
94 94
          */
95
-        $post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
95
+        $post_map_json = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post);
96 96
 
97 97
         // only assign it if it has a value
98
-        if($post_map_json){
98
+        if ($post_map_json) {
99 99
             $map_jason[$post->ID] = $post_map_json;
100 100
         }
101 101
 
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
             if (is_array($map_jason) && !empty($map_jason)) {
120 120
 
121 121
                 // on details page only show the main marker on the map
122
-                if(geodir_is_page('detail')){
122
+                if (geodir_is_page('detail')) {
123 123
                     global $post;
124
-                    if(isset($map_jason[$post->ID])){
124
+                    if (isset($map_jason[$post->ID])) {
125 125
                         $map_jason = array($map_jason[$post->ID]);
126 126
                     }
127 127
                 }
128
-                $canvas_jason = $canvas . "_jason";
128
+                $canvas_jason = $canvas."_jason";
129 129
                 $map_canvas_arr[$canvas] = array_unique($map_jason);
130 130
                 unset($cat_content_info);
131 131
                 $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
                     $json_content = substr(implode(',', $cat_content_info), 1);
135 135
                     $json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
136 136
                     $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08
137
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
137
+                    $canvas_jason = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
138 138
                 } else {
139 139
                     $canvas_jason = '[{"totalcount":"0"}]';
140 140
                 }
141
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
141
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
142 142
 
143 143
                 /**
144 144
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
                  * @param string $canvas Map canvas array key.
151 151
                  * @param array $map_canvas_jason_args Map canvas args.
152 152
                  */
153
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
153
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
154 154
 
155
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
155
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
156 156
             } else {
157 157
                 $canvas_jason = '[{"totalcount":"0"}]';
158
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
158
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
159 159
 
160 160
                 /**
161 161
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
                  * @param string $canvas Map canvas array key.
168 168
                  * @param array $map_canvas_jason_args Map canvas args.
169 169
                  */
170
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
171
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
170
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
171
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
172 172
             }
173 173
         }
174 174
 
@@ -230,11 +230,11 @@  discard block
 block discarded – undo
230 230
         }
231 231
 
232 232
 
233
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
233
+        $out = '<ul class="treeview '.$list_class.'" style="margin-left:'.$p.'px;'.$display.';">';
234 234
 
235 235
         $geodir_cat_icons = geodir_get_term_icon();
236 236
 
237
-        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
237
+        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place';
238 238
         $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : $geodir_default_map_search_pt;
239 239
         foreach ($cat_terms as $cat_term):
240 240
 
@@ -252,19 +252,19 @@  discard block
 block discarded – undo
252 252
                         global $sitepress;
253 253
                         $default_lang = $sitepress->get_default_language();
254 254
                         $term_id = icl_object_id($cat_term->term_id, $post_type.'category', true, $default_lang);
255
-                    }else{
255
+                    } else {
256 256
                         $term_id = $cat_term->term_id;
257 257
                     }
258
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) {
258
+                    if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$term_id, $geodir_home_map_untick)) {
259 259
                         $checked = '';
260 260
                     }
261 261
                 }
262 262
 
263
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
264
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
265
-                $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)">';
266
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
267
-                $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>';
263
+                $term_check = '<input type="checkbox" '.$checked.' id="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'" class="group_selector '.$main_list_class.'"';
264
+                $term_check .= ' name="'.$map_canvas_name.'_cat[]" ';
265
+                $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)">';
266
+                $term_img = '<img height="15" width="15" alt="'.$cat_term->taxonomy.'" src="'.$icon.'" title="'.ucfirst($cat_term->name).'"/>';
267
+                $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>';
268 268
 
269 269
             endif;
270 270
 
@@ -376,18 +376,18 @@  discard block
 block discarded – undo
376 376
  * @package GeoDirectory
377 377
  */
378 378
 function geodir_map_load_script() {
379
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
379
+    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) {
380 380
         $plugin_url = geodir_plugin_url();
381 381
 ?>
382 382
 <script type="text/javascript">
383 383
 if (!(window.google && typeof google.maps !== 'undefined')) {
384
-    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION;?>");
384
+    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION; ?>");
385 385
     document.getElementsByTagName("head")[0].appendChild(css);
386
-    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION;?>");
386
+    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION; ?>");
387 387
     document.getElementsByTagName("head")[0].appendChild(css);
388
-    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $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 $plugin_url;?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
390
-    document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
388
+    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $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 $plugin_url; ?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
390
+    document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
391 391
 }
392 392
 </script>
393 393
 <?php
Please login to merge, or discard this patch.