Test Failed
Pull Request — master (#306)
by Kiran
16:19
created
geodirectory_template_tags.php 1 patch
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
     $is_detail_page = false;
39 39
     $geodir_map_name = geodir_map_name();
40 40
 
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
41
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
42 42
         $is_detail_page = true;
43 43
     }
44 44
 
45 45
     wp_enqueue_script('jquery');
46 46
 
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
48 48
     wp_enqueue_script('geodirectory-script');
49 49
 
50 50
     $geodir_vars_data = array(
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
53
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
54 54
         'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
56 56
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57 57
     );
58 58
 
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * }
75 75
      */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
77 77
 
78 78
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79 79
 
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
80
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
81
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
82 82
 
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
84 84
     wp_enqueue_script('geodirectory-lightbox-jquery');
85 85
 
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     if ($is_detail_page) {
88 88
         wp_enqueue_script('geodirectory-jquery-simplemodal');
89 89
     }
90 90
 
91 91
     if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
92
+        $map_lang = "&language=".geodir_get_map_default_language();
93
+        $map_key = "&key=".geodir_get_map_api_key();
94 94
         /**
95 95
          * Filter the variables that are added to the end of the google maps script call.
96 96
          *
@@ -100,48 +100,48 @@  discard block
 block discarded – undo
100 100
          * @param string $var The string to filter, default is empty string.
101 101
          */
102 102
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
103
+        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
104 104
     }
105 105
     
106 106
     if ($geodir_map_name == 'osm') {
107 107
         // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109 109
         wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112 112
         wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115 115
         wp_enqueue_script('geodirectory-leaflet-geo-script');
116 116
         
117 117
         if ($is_detail_page) {
118
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
118
+            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119 119
             wp_enqueue_style('geodirectory-leaflet-routing-style');
120 120
                 
121
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
121
+            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122 122
             wp_enqueue_script('geodirectory-leaflet-routing-script');
123 123
         }
124 124
     }
125
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
125
+    wp_enqueue_script('jquery-ui-autocomplete');
126 126
     
127
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
127
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
128 128
     wp_enqueue_script('geodirectory-goMap-script');
129 129
 
130 130
 
131
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
131
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132 132
     wp_enqueue_script('chosen');
133 133
 
134
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
134
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135 135
     wp_enqueue_script('geodirectory-choose-ajax');
136 136
 
137
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
137
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138 138
 
139 139
     if (is_page() && geodir_is_page('add-listing')) {
140 140
         // SCRIPT FOR UPLOAD
141 141
         wp_enqueue_script('plupload-all');
142 142
         wp_enqueue_script('jquery-ui-sortable');
143 143
 
144
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
144
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
145 145
         wp_enqueue_script('geodirectory-plupload-script');
146 146
         // SCRIPT FOR UPLOAD END
147 147
 
@@ -188,27 +188,27 @@  discard block
 block discarded – undo
188 188
 
189 189
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190 190
 
191
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
191
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
192 192
     } // End if for add place page
193 193
 
194
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
194
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195 195
     if ($is_detail_page) {
196 196
 		wp_enqueue_script('geodirectory-post-custom-js');
197 197
 	}
198 198
 
199 199
     // font awesome rating script
200 200
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
201
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
201
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
202 202
 		wp_enqueue_script('geodir-barrating-js');
203 203
 	} else { // default rating script
204
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
204
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
205 205
 		wp_enqueue_script('geodir-jRating-js');
206 206
 	}
207 207
 
208
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
208
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209 209
     wp_enqueue_script('geodir-on-document-load');
210 210
 
211
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
211
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212 212
     wp_enqueue_script('google-geometa');
213 213
 }
214 214
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
  */
224 224
 function geodir_header_scripts()
225 225
 {
226
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
226
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
227 227
     echo stripslashes(get_option('geodir_header_scripts'));
228 228
 }
229 229
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 function geodir_footer_scripts()
241 241
 {
242 242
 
243
-    if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
243
+    if (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')) {?>
244 244
 
245 245
         <script>
246 246
             (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -248,14 +248,14 @@  discard block
 block discarded – undo
248 248
                 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
249 249
             })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
250 250
 
251
-            ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto');
252
-            <?php if(get_option('geodir_ga_anonymize_ip')){echo "ga('set', 'anonymizeIP', true);";}?>
251
+            ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto');
252
+            <?php if (get_option('geodir_ga_anonymize_ip')) {echo "ga('set', 'anonymizeIP', true);"; }?>
253 253
             ga('send', 'pageview');
254 254
 
255 255
         </script>
256 256
 
257 257
 <?php
258
-    }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
258
+    }elseif (get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) {
259 259
         echo stripslashes(get_option('geodir_ga_tracking_code'));
260 260
     }
261 261
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      *
267 267
      * Flexbox wont wrap on ios for search form items
268 268
      */
269
-    if (preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
269
+    if (preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
270 270
         echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
271 271
     }
272 272
 }
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
  */
283 283
 function geodir_add_async_forscript($url)
284 284
 {
285
-    if (strpos($url, '#asyncload')===false)
285
+    if (strpos($url, '#asyncload') === false)
286 286
         return $url;
287 287
     else if (is_admin())
288 288
         return str_replace('#asyncload', '', $url);
@@ -300,12 +300,12 @@  discard block
 block discarded – undo
300 300
 function geodir_templates_styles()
301 301
 {
302 302
 
303
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
303
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
304 304
     wp_enqueue_style('geodir-core-scss');
305
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
305
+    wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
306 306
 
307
-    if(is_rtl()){
308
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
307
+    if (is_rtl()) {
308
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
309 309
     wp_enqueue_style('geodirectory-frontend-rtl-style');
310 310
     }
311 311
 
@@ -379,18 +379,18 @@  discard block
 block discarded – undo
379 379
                 $term_id = get_queried_object_id();
380 380
                 $taxonomy = get_query_var('taxonomy');
381 381
 
382
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
383
-                    $term = get_term($term_id, $post_type . 'category');
382
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
383
+                    $term = get_term($term_id, $post_type.'category');
384 384
                 }
385 385
             }
386 386
             
387
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
388
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
387
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
388
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
389 389
                 
390 390
                 if (!is_array($taxonomy_search)) {
391
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
392
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
393
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
391
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
392
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
393
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
394 394
                 }
395 395
             }
396 396
             
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
         if ($max_page > 1 || $always_show) {            
403 403
             // Extra pagination info
404 404
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
405
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
405
+            $start_no = ($paged - 1) * $posts_per_page + 1;
406 406
             $end_no = min($paged * $posts_per_page, $numposts);
407 407
 
408 408
             if ($geodir_pagination_more_info != '') {
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
                 } else {
413 413
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
414 414
                 }
415
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
415
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
416 416
                 /**
417 417
                  * Adds an extra pagination info above/under pagination.
418 418
                  *
@@ -428,15 +428,15 @@  discard block
 block discarded – undo
428 428
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
429 429
                 
430 430
                 if ($geodir_pagination_more_info == 'before') {
431
-                    $before = $before . $pagination_info;
431
+                    $before = $before.$pagination_info;
432 432
                 } else if ($geodir_pagination_more_info == 'after') {
433
-                    $after = $pagination_info . $after;
433
+                    $after = $pagination_info.$after;
434 434
                 }
435 435
             }
436 436
             
437 437
             echo "$before <div class='Navi gd-navi'>";
438 438
             if ($paged >= ($pages_to_show - 1)) {
439
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
439
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
440 440
             }
441 441
             previous_posts_link($prelabel);
442 442
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -444,13 +444,13 @@  discard block
 block discarded – undo
444 444
                     if ($i == $paged) {
445 445
                         echo "<strong class='on'>$i</strong>";
446 446
                     } else {
447
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
447
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
448 448
                     }
449 449
                 }
450 450
             }
451 451
             next_posts_link($nxtlabel, $max_page);
452 452
             if (($paged + $half_pages_to_show) < ($max_page)) {
453
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
453
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
454 454
             }
455 455
             echo "</div> $after";
456 456
         }
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
         jQuery(function ($) {
489 489
             $("#distance_slider").slider({
490 490
                 range: true,
491
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
491
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
492 492
                 min: 0,
493 493
                 max: <?php echo $dist; ?>,
494 494
                 step: <?php echo $dist_dif; ?>,
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
     $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
556 556
     ?>
557 557
     <script type="text/javascript">
558
-        var default_location = '<?php echo $city ;?>';
558
+        var default_location = '<?php echo $city; ?>';
559 559
         var latlng;
560 560
         var address;
561 561
         var dist = 0;
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 				var $form = jQuery(this).closest('form');
572 572
 
573 573
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
574
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
574
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
575 575
 				
576 576
 				// Disable location based search for disabled location post type.
577 577
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 					}
586 586
 				}
587 587
 				
588
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
588
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
589 589
 					geodir_setsearch($form);
590 590
 				} else {
591 591
 					jQuery(".snear", $form).val('');
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
         });
604 604
         
605 605
 		function geodir_setsearch($form) {
606
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
606
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
607 607
 			geocodeAddress($form);
608 608
 		}
609 609
 
@@ -622,15 +622,15 @@  discard block
 block discarded – undo
622 622
             // Call the geocode function
623 623
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
624 624
 
625
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
626
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
625
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
626
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
627 627
                     jQuery(".snear", $form).val('');
628 628
                 }
629 629
                 jQuery($form).submit();
630 630
             } else {
631 631
                 var address = jQuery(".snear", $form).val();
632 632
 
633
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
633
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
634 634
                     initialise2();
635 635
                 } else {
636 636
                     <?php
@@ -643,12 +643,12 @@  discard block
 block discarded – undo
643 643
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
644 644
                     ?>
645 645
                     if (window.gdMaps === 'google') {
646
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
646
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
647 647
                             function (results, status) {
648 648
                                 if (status == google.maps.GeocoderStatus.OK) {
649 649
                                     updateSearchPosition(results[0].geometry.location, $form);
650 650
                                 } else {
651
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
651
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
652 652
                                 }
653 653
                             });
654 654
                     } else if (window.gdMaps === 'osm') {
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
658 658
                                     updateSearchPosition(geo, $form);
659 659
                                 } else {
660
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
660
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
661 661
                                 }
662 662
                             });
663 663
                     } else {
@@ -703,19 +703,19 @@  discard block
 block discarded – undo
703 703
             var msg;
704 704
             switch (err.code) {
705 705
                 case err.UNKNOWN_ERROR:
706
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
706
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
707 707
                     break;
708 708
                 case err.PERMISSION_DENINED:
709
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
709
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
710 710
                     break;
711 711
                 case err.POSITION_UNAVAILABLE:
712
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
712
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
713 713
                     break;
714 714
                 case err.BREAK:
715
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
715
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
716 716
                     break;
717 717
                 default:
718
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
718
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
719 719
             }
720 720
             jQuery('#info').html(msg);
721 721
         }
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
              * @param object $post The post object.
755 755
              * @param string $link The link to the post.
756 756
              */
757
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
757
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
758 758
             break;
759 759
         case 'new' :
760 760
             /**
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
              * @param object $post The post object.
765 765
              * @param string $link The link to the post.
766 766
              */
767
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
767
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
768 768
             break;
769 769
 
770 770
     }
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_on_add_listing_page.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
     window.gdMaps = window.gdMaps || gdMaps;
83 83
     
84 84
     user_address = false;
85
-    jQuery('#<?php echo $prefix.'address';?>').keypress(function () {
85
+    jQuery('#<?php echo $prefix.'address'; ?>').keypress(function () {
86 86
         user_address = true;
87 87
     });
88 88
 
89 89
     baseMarker = '';
90 90
     geocoder = '';
91
-    var <?php echo $prefix;?>CITY_MAP_CENTER_LAT = <?php echo ($lat) ? $lat :  '39.952484'; ?>;
92
-    var <?php echo $prefix;?>CITY_MAP_CENTER_LNG = <?php echo ($lng) ? $lng :  '-75.163786'; ?>;
93
-    <?php if($lat_lng_blank){$lat='';$lng='';}?>
94
-    var <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT = <?php echo ($mapzoom) ? $mapzoom : 12;?>;
91
+    var <?php echo $prefix; ?>CITY_MAP_CENTER_LAT = <?php echo ($lat) ? $lat : '39.952484'; ?>;
92
+    var <?php echo $prefix; ?>CITY_MAP_CENTER_LNG = <?php echo ($lng) ? $lng : '-75.163786'; ?>;
93
+    <?php if ($lat_lng_blank) {$lat = ''; $lng = ''; }?>
94
+    var <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT = <?php echo ($mapzoom) ? $mapzoom : 12; ?>;
95 95
     var minZoomLevel = <?php echo ($is_map_restrict) ? 5 : 0; ?>;
96 96
     var oldstr_address;
97 97
     var oldstr_zip;
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
             do_action('geodir_add_listing_geocode_js_vars');
341 341
             ?>
342 342
             <?php if ($is_map_restrict) { ?>
343
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
344
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
345
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
343
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
344
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
345
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
346 346
                 jQuery.goMap.map.setCenter(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
347 347
                 baseMarker.setPosition(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
348 348
                 updateMarkerPosition(baseMarker.getPosition());
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
             <?php } ?>
352 352
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
353 353
         } else {
354
-            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
354
+            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
355 355
         }
356 356
     }
357 357
     function centerMap(latlng) {
358
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
358
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
359 359
         if (window.gdMaps == 'google') {
360 360
             jQuery.goMap.map.panTo(baseMarker.getPosition());
361 361
         } else if (window.gdMaps == 'osm') {
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         }
365 365
     }
366 366
     function centerMarker() {
367
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
367
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
368 368
         var center = jQuery.goMap.map.getCenter();
369 369
         if (window.gdMaps == 'google') {
370 370
             baseMarker.setPosition(center);
@@ -373,48 +373,48 @@  discard block
 block discarded – undo
373 373
         }
374 374
     }
375 375
     function updateMapZoom(zoom) {
376
-        jQuery('#<?php echo $prefix.'mapzoom';?>').val(zoom);
376
+        jQuery('#<?php echo $prefix.'mapzoom'; ?>').val(zoom);
377 377
     }
378 378
     function updateMarkerPosition(markerlatLng) {
379
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
380
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat());
381
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng());
379
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
380
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat());
381
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng());
382 382
     }
383 383
     function updateMarkerPositionOSM(markerlatLng) {
384
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat);
385
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng);
384
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat);
385
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng);
386 386
     }
387 387
     function updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry) {
388
-        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields);?>';
389
-        <?php ob_start();?>
390
-        var old_country = jQuery("#<?php echo $prefix.'country';?>").val();
391
-        var old_region = jQuery("#<?php echo $prefix.'region';?>").val();
388
+        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields); ?>';
389
+        <?php ob_start(); ?>
390
+        var old_country = jQuery("#<?php echo $prefix.'country'; ?>").val();
391
+        var old_region = jQuery("#<?php echo $prefix.'region'; ?>").val();
392 392
         
393
-        if (user_address == false || jQuery('#<?php echo $prefix.'address';?>').val() == '') {
394
-            jQuery("#<?php echo $prefix.'address';?>").val(getAddress);
393
+        if (user_address == false || jQuery('#<?php echo $prefix.'address'; ?>').val() == '') {
394
+            jQuery("#<?php echo $prefix.'address'; ?>").val(getAddress);
395 395
         }
396 396
         if (getAddress) {
397 397
             oldstr_address = getAddress;
398 398
         }
399 399
 
400
-        jQuery("#<?php echo $prefix.'zip';?>").val(getZip);
400
+        jQuery("#<?php echo $prefix.'zip'; ?>").val(getZip);
401 401
         if (getZip) {
402 402
             oldstr_zip = getZip;
403 403
         }
404 404
         if (set_map_val_in_fields) {
405 405
             if (getCountry) {
406
-                jQuery('#<?php echo $prefix .'country'; ?> option[value=""]').attr("selected",false);
407
-                jQuery('#<?php echo $prefix.'country';?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
408
-                jQuery("#<?php echo $prefix.'country';?>").trigger("chosen:updated");
406
+                jQuery('#<?php echo $prefix.'country'; ?> option[value=""]').attr("selected",false);
407
+                jQuery('#<?php echo $prefix.'country'; ?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
408
+                jQuery("#<?php echo $prefix.'country'; ?>").trigger("chosen:updated");
409 409
             }
410 410
             if (getState) {
411
-                if (jQuery('input[id="<?php echo $prefix.'region';?>"]').attr('id')) {
412
-                    jQuery("#<?php echo $prefix.'region';?>").val(getState);
411
+                if (jQuery('input[id="<?php echo $prefix.'region'; ?>"]').attr('id')) {
412
+                    jQuery("#<?php echo $prefix.'region'; ?>").val(getState);
413 413
                 }
414 414
             }
415 415
             if (getCity) {
416
-                if (jQuery('input[id="<?php echo $prefix.'city';?>"]').attr('id')) {
417
-                    jQuery("#<?php echo $prefix.'city';?>").val(getCity);
416
+                if (jQuery('input[id="<?php echo $prefix.'city'; ?>"]').attr('id')) {
417
+                    jQuery("#<?php echo $prefix.'city'; ?>").val(getCity);
418 418
                 }
419 419
             }
420 420
         }
@@ -430,15 +430,15 @@  discard block
 block discarded – undo
430 430
         ?>
431 431
     }
432 432
     function geodir_codeAddress(set_on_map) {
433
-        var address = jQuery('#<?php echo $prefix.'address';?>').val();
434
-        var zip = jQuery('#<?php echo $prefix.'zip';?>').val();
435
-        var city = jQuery('#<?php echo $prefix.'city';?>').val();
436
-        var region = jQuery('#<?php echo $prefix.'region';?>').val();
437
-        var country = jQuery('#<?php echo $prefix.'country';?>').val();
438
-        var country_selected = jQuery('#<?php echo $prefix.'country';?>').find('option:selected');
433
+        var address = jQuery('#<?php echo $prefix.'address'; ?>').val();
434
+        var zip = jQuery('#<?php echo $prefix.'zip'; ?>').val();
435
+        var city = jQuery('#<?php echo $prefix.'city'; ?>').val();
436
+        var region = jQuery('#<?php echo $prefix.'region'; ?>').val();
437
+        var country = jQuery('#<?php echo $prefix.'country'; ?>').val();
438
+        var country_selected = jQuery('#<?php echo $prefix.'country'; ?>').find('option:selected');
439 439
         var ISO2 = country_selected.data('country_code');
440
-        if (!ISO2 && jQuery('#<?php echo $prefix.'country';?>').data('country_code')) {
441
-            ISO2 = jQuery('#<?php echo $prefix.'country';?>').data('country_code');
440
+        if (!ISO2 && jQuery('#<?php echo $prefix.'country'; ?>').data('country_code')) {
441
+            ISO2 = jQuery('#<?php echo $prefix.'country'; ?>').data('country_code');
442 442
         }
443 443
         if (ISO2 == '--') {
444 444
             ISO2 = '';
@@ -447,13 +447,13 @@  discard block
 block discarded – undo
447 447
             zip = '';
448 448
         }
449 449
         if (typeof city == "undefined") {
450
-            city = '<?php echo addslashes_gpc($city);?>';
450
+            city = '<?php echo addslashes_gpc($city); ?>';
451 451
         }
452 452
         if (typeof region == "undefined") {
453
-            region = '<?php echo addslashes_gpc($region);?>';
453
+            region = '<?php echo addslashes_gpc($region); ?>';
454 454
         }
455 455
         if (typeof country == "undefined") {
456
-            country = '<?php echo addslashes_gpc($country);?>';
456
+            country = '<?php echo addslashes_gpc($country); ?>';
457 457
         }
458 458
         var is_restrict = '<?php echo $is_map_restrict; ?>';
459 459
         <?php ob_start();
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             if (typeof address === 'undefined')
469 469
                 address = '';
470 470
             <?php
471
-            if(is_admin() && isset($_REQUEST['tab'])){?>
471
+            if (is_admin() && isset($_REQUEST['tab'])) {?>
472 472
             if (jQuery.trim(city) == '' || jQuery.trim(region) == '') {
473 473
                 address = '';
474 474
             }
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
             geocoder.geocode({'address': address, 'country': ISO2},
516 516
                 function (results, status) {
517 517
                     console.log(status);
518
-                    jQuery("#<?php echo $prefix.'map';?>").goMap();
518
+                    jQuery("#<?php echo $prefix.'map'; ?>").goMap();
519 519
                     if (status == google.maps.GeocoderStatus.OK) {
520 520
                         baseMarker.setPosition(results[0].geometry.location);
521 521
                         jQuery.goMap.map.setCenter(results[0].geometry.location);
@@ -532,21 +532,21 @@  discard block
 block discarded – undo
532 532
                         geocodePosition(baseMarker.getPosition(), {'address': address, 'country': ISO2});
533 533
                         //}
534 534
                     } else {
535
-                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:','geodirectory'));?> ' + status);
535
+                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:', 'geodirectory')); ?> ' + status);
536 536
                     }
537 537
                 });
538 538
         }
539 539
     }
540 540
     function gdMaxMap() {
541
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
541
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
542 542
 
543
-        jQuery('#<?php echo $prefix.'map';?>').toggleClass('map-fullscreen');
543
+        jQuery('#<?php echo $prefix.'map'; ?>').toggleClass('map-fullscreen');
544 544
         jQuery('.map_category').toggleClass('map_category_fullscreen');
545
-        jQuery('#<?php echo $prefix;?>trigger').toggleClass('map_category_fullscreen');
545
+        jQuery('#<?php echo $prefix; ?>trigger').toggleClass('map_category_fullscreen');
546 546
         jQuery('body').toggleClass('body_fullscreen');
547
-        jQuery('#<?php echo $prefix;?>loading_div').toggleClass('loading_div_fullscreen');
548
-        jQuery('#<?php echo $prefix;?>advmap_nofound').toggleClass('nofound_fullscreen');
549
-        jQuery('#<?php echo $prefix;?>triggermap').toggleClass('triggermap_fullscreen');
547
+        jQuery('#<?php echo $prefix; ?>loading_div').toggleClass('loading_div_fullscreen');
548
+        jQuery('#<?php echo $prefix; ?>advmap_nofound').toggleClass('nofound_fullscreen');
549
+        jQuery('#<?php echo $prefix; ?>triggermap').toggleClass('triggermap_fullscreen');
550 550
         jQuery('.TopLeft').toggleClass('TopLeft_fullscreen');
551 551
         window.setTimeout(function () {
552 552
             if (window.gdMaps == 'google') {
@@ -582,9 +582,9 @@  discard block
 block discarded – undo
582 582
             do_action('geodir_add_listing_geocode_js_vars');
583 583
             ?>
584 584
             <?php if ($is_map_restrict) { ?>
585
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
586
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
587
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
585
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
586
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
587
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
588 588
                 centerMap(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
589 589
                 baseMarker.setLatLng(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
590 590
                 updateMarkerPositionOSM(baseMarker.getLatLng());
@@ -593,39 +593,39 @@  discard block
 block discarded – undo
593 593
             <?php } ?>
594 594
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
595 595
         } else {
596
-            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
596
+            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
597 597
         }
598 598
     }
599 599
     
600 600
     jQuery(function ($) {
601
-        $("#<?php echo $prefix.'map';?>").goMap({
602
-            latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
603
-            longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
604
-            zoom: <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT,
601
+        $("#<?php echo $prefix.'map'; ?>").goMap({
602
+            latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
603
+            longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
604
+            zoom: <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT,
605 605
             maptype: 'ROADMAP', // Map type - HYBRID, ROADMAP, SATELLITE, TERRAIN
606 606
             streetViewControl: true,
607
-            <?php if(get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,';}?>
607
+            <?php if (get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,'; }?>
608 608
         });
609 609
 
610 610
         if (window.gdMaps) {
611 611
             geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : [];
612 612
 
613 613
             baseMarker = $.goMap.createMarker({
614
-                latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
615
-                longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
614
+                latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
615
+                longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
616 616
                 id: 'baseMarker',
617
-                icon: '<?php echo $marker_icon;?>',
617
+                icon: '<?php echo $marker_icon; ?>',
618 618
                 draggable: true,
619 619
                 addToMap: true, // For OSM
620
-                w: parseFloat('<?php echo $icon_size['w'];?>'),
621
-                h: parseFloat('<?php echo $icon_size['h'];?>'),
620
+                w: parseFloat('<?php echo $icon_size['w']; ?>'),
621
+                h: parseFloat('<?php echo $icon_size['h']; ?>'),
622 622
             });
623 623
         } else {
624
-            jQuery('#<?php echo $prefix.'advmap_nofound';?>').hide();
625
-            jQuery('#<?php echo $prefix.'advmap_notloaded';?>').show();
624
+            jQuery('#<?php echo $prefix.'advmap_nofound'; ?>').hide();
625
+            jQuery('#<?php echo $prefix.'advmap_notloaded'; ?>').show();
626 626
         }
627 627
         
628
-        $("#<?php echo $prefix;?>set_address_button").click(function () {
628
+        $("#<?php echo $prefix; ?>set_address_button").click(function () {
629 629
             var set_on_map = true;
630 630
             geodir_codeAddress(set_on_map);
631 631
         });
@@ -659,14 +659,14 @@  discard block
 block discarded – undo
659 659
                 updateMapZoom($.goMap.map.zoom);
660 660
             });
661 661
 
662
-            var maxMap = document.getElementById('<?php echo $prefix;?>triggermap');
662
+            var maxMap = document.getElementById('<?php echo $prefix; ?>triggermap');
663 663
             google.maps.event.addDomListener(maxMap, 'click', gdMaxMap);
664 664
 
665 665
             <?php if ($is_map_restrict) { ?>
666
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country);?>';
666
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country); ?>';
667 667
             geocoder.geocode({'address': CITY_ADDRESS},
668 668
                 function (results, status) {
669
-                    $("#<?php echo $prefix.'map';?>").goMap();
669
+                    $("#<?php echo $prefix.'map'; ?>").goMap();
670 670
                     if (status == google.maps.GeocoderStatus.OK) {
671 671
                         // Bounds for North America
672 672
                         var bound_lat_lng = String(results[0].geometry.bounds);
@@ -677,13 +677,13 @@  discard block
 block discarded – undo
677 677
                             new google.maps.LatLng(bound_lat_lng[2], bound_lat_lng[3])
678 678
                         );
679 679
                     } else {
680
-                        alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status);
680
+                        alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status);
681 681
                     }
682 682
                 });
683 683
             <?php } ?>
684 684
             // Limit the zoom level
685 685
             google.maps.event.addListener($.goMap.map, 'zoom_changed', function () {
686
-                $("#<?php echo $prefix.'map';?>").goMap();
686
+                $("#<?php echo $prefix.'map'; ?>").goMap();
687 687
                 if ($.goMap.map.getZoom() < minZoomLevel) $.goMap.map.setZoom(minZoomLevel);
688 688
             });
689 689
         } else if (window.gdMaps == 'osm') {
@@ -709,10 +709,10 @@  discard block
 block discarded – undo
709 709
                 updateMapZoom($.goMap.map.getZoom());
710 710
             });
711 711
 
712
-            L.DomEvent.addListener($('<?php echo $prefix;?>triggermap'), 'click', gdMaxMap);
712
+            L.DomEvent.addListener($('<?php echo $prefix; ?>triggermap'), 'click', gdMaxMap);
713 713
 
714 714
             <?php if ($is_map_restrict) { ?>
715
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country);?>';
715
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country); ?>';
716 716
             geocodePositionOSM('', CITY_ADDRESS);
717 717
             <?php } ?>
718 718
             // Limit the zoom level
@@ -735,14 +735,14 @@  discard block
 block discarded – undo
735 735
 <div class="top_banner_section_inn geodir_map_container clearfix" style="margin-top:10px;">
736 736
     <div class="TopLeft"><span id="<?php echo $prefix; ?>triggermap" style="margin-top:-11px;margin-left:-12px;"></span></div>
737 737
     <div class="TopRight"></div>
738
-    <div id="<?php echo $prefix . 'map'; ?>" class="geodir_map" style="height:300px">
738
+    <div id="<?php echo $prefix.'map'; ?>" class="geodir_map" style="height:300px">
739 739
         <!-- new map start -->
740 740
         <div class="iprelative">
741
-            <div id="<?php echo $prefix . 'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
741
+            <div id="<?php echo $prefix.'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
742 742
             <div id="<?php echo $prefix; ?>loading_div" style="height:300px"></div>
743 743
             <div id="<?php echo $prefix; ?>advmap_counter"></div>
744 744
             <div id="<?php echo $prefix; ?>advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
745
-            <div id="<?php echo $prefix;?>advmap_notloaded" class="advmap_notloaded"><?php _e('<h3>Map Not Loaded</h3><p>Sorry, unable to load Maps API.', 'geodirectory'); ?></div>
745
+            <div id="<?php echo $prefix; ?>advmap_notloaded" class="advmap_notloaded"><?php _e('<h3>Map Not Loaded</h3><p>Sorry, unable to load Maps API.', 'geodirectory'); ?></div>
746 746
         </div>
747 747
         <!-- new map end -->
748 748
     </div>
Please login to merge, or discard this patch.