Test Failed
Push — master ( 64deb5...8339b1 )
by Stiofan
09:03
created
geodirectory-functions/map-functions/map_functions.php 1 patch
Spacing   +28 added lines, -28 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,7 +92,7 @@  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
-        $map_jason[$post->ID] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
95
+        $map_jason[$post->ID] = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post);
96 96
     }
97 97
 }
98 98
 
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
             if (is_array($map_jason) && !empty($map_jason)) {
114 114
 
115 115
                 // on details page only show the main marker on the map
116
-                if(geodir_is_page('detail')){
116
+                if (geodir_is_page('detail')) {
117 117
                     global $post;
118
-                    if(isset($map_jason[$post->ID])){
118
+                    if (isset($map_jason[$post->ID])) {
119 119
                         $map_jason = array($map_jason[$post->ID]);
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,11 +127,11 @@  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, get_option('blog_charset')); // 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
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
134
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
135 135
 
136 136
                 /**
137 137
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
                  * @param string $canvas Map canvas array key.
144 144
                  * @param array $map_canvas_jason_args Map canvas args.
145 145
                  */
146
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
146
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
147 147
 
148
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
148
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
149 149
             } else {
150 150
                 $canvas_jason = '[{"totalcount":"0"}]';
151
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
151
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
152 152
 
153 153
                 /**
154 154
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
                  * @param string $canvas Map canvas array key.
161 161
                  * @param array $map_canvas_jason_args Map canvas args.
162 162
                  */
163
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
164
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
163
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
164
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
165 165
             }
166 166
         }
167 167
 
@@ -223,11 +223,11 @@  discard block
 block discarded – undo
223 223
         }
224 224
 
225 225
 
226
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
226
+        $out = '<ul class="treeview '.$list_class.'" style="margin-left:'.$p.'px;'.$display.';">';
227 227
 
228 228
         $geodir_cat_icons = geodir_get_term_icon();
229 229
 
230
-        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
230
+        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place';
231 231
         $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : $geodir_default_map_search_pt;
232 232
         foreach ($cat_terms as $cat_term):
233 233
 
@@ -241,16 +241,16 @@  discard block
 block discarded – undo
241 241
 
242 242
                 // Untick the category by default on home map
243 243
                 if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
244
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
244
+                    if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$cat_term->term_id, $geodir_home_map_untick)) {
245 245
                         $checked = '';
246 246
                     }
247 247
                 }
248 248
 
249
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
250
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
251
-                $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)">';
252
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
253
-                $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>';
249
+                $term_check = '<input type="checkbox" '.$checked.' id="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'" class="group_selector '.$main_list_class.'"';
250
+                $term_check .= ' name="'.$map_canvas_name.'_cat[]" ';
251
+                $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)">';
252
+                $term_img = '<img height="15" width="15" alt="'.$cat_term->taxonomy.'" src="'.$icon.'" title="'.ucfirst($cat_term->name).'"/>';
253
+                $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>';
254 254
 
255 255
             endif;
256 256
 
@@ -362,18 +362,18 @@  discard block
 block discarded – undo
362 362
  * @package GeoDirectory
363 363
  */
364 364
 function geodir_map_load_script() {
365
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
365
+    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) {
366 366
         $plugin_url = geodir_plugin_url();
367 367
 ?>
368 368
 <script type="text/javascript">
369 369
 if (!(window.google && typeof google.maps !== 'undefined')) {
370
-    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;?>");
370
+    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; ?>");
371 371
     document.getElementsByTagName("head")[0].appendChild(css);
372
-    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;?>");
372
+    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; ?>");
373 373
     document.getElementsByTagName("head")[0].appendChild(css);
374
-    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>');
375
-    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>');
376
-    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>');
374
+    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>');
375
+    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>');
376
+    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>');
377 377
 }
378 378
 </script>
379 379
 <?php
Please login to merge, or discard this patch.