Test Failed
Push — master ( d171f7...914470 )
by Stiofan
18:50
created
geodirectory-functions/map-functions/map_on_add_listing_page.php 2 patches
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -35,19 +35,19 @@  discard block
 block discarded – undo
35 35
 $defaultcity = isset($default_location->city) ? $default_location->city : '';
36 36
 $lat_lng_blank = false;
37 37
 if ($lat == '' && $lng == '') {
38
-    $lat_lng_blank = true;
39
-    $city = $defaultcity;
40
-    $region = isset($default_location->region) ? $default_location->region : '';
41
-    $country = isset($default_location->country) ? $default_location->country : '';
42
-    $lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
43
-    $lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
38
+	$lat_lng_blank = true;
39
+	$city = $defaultcity;
40
+	$region = isset($default_location->region) ? $default_location->region : '';
41
+	$country = isset($default_location->country) ? $default_location->country : '';
42
+	$lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
43
+	$lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
44 44
 }
45 45
 $default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
46 46
 $default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
47 47
 if (is_admin() && isset($_REQUEST['tab']) && $mapzoom == '') {
48
-    $mapzoom = 4;
49
-    if (isset($_REQUEST['add_hood']))
50
-        $mapzoom = 10;
48
+	$mapzoom = 4;
49
+	if (isset($_REQUEST['add_hood']))
50
+		$mapzoom = 10;
51 51
 }
52 52
 
53 53
 /**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * Fires at the start of the add javascript on the add lsitings map.
69 69
 	 *
70 70
 	 * @since 1.0.0
71
-     * @param string $prefix The prefix for all elements.
71
+	 * @param string $prefix The prefix for all elements.
72 72
 	 */
73 73
 	do_action('geodir_add_listing_js_start', $prefix);
74 74
 	?>
@@ -260,12 +260,12 @@  discard block
 block discarded – undo
260 260
             // fix for regions in GB
261 261
 
262 262
             $country_arr = <?php
263
-            /**
264
-             * Filter the regions array that uses administrative_area_level_2 instead of administrative_area_level_1.
265
-             *
266
-             * @since 1.6.16
267
-             */
268
-            echo apply_filters("geodir_geocode_region_level",'["GB","ES"]');?>;
263
+			/**
264
+			 * Filter the regions array that uses administrative_area_level_2 instead of administrative_area_level_1.
265
+			 *
266
+			 * @since 1.6.16
267
+			 */
268
+			echo apply_filters("geodir_geocode_region_level",'["GB","ES"]');?>;
269 269
             if (jQuery.inArray(rr, $country_arr) !== -1) {
270 270
                 if (administrative_area_level_2.long_name) {
271 271
                     getState = administrative_area_level_2.long_name;
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
                 getZip = postal_code.long_name;
347 347
             }
348 348
             <?php 
349
-            /**
350
-             * Fires to add javascript variable to use in google map.
351
-             *
352
-             * @since 1.0.0
353
-             */
354
-            do_action('geodir_add_listing_geocode_js_vars');
355
-            ?>
349
+			/**
350
+			 * Fires to add javascript variable to use in google map.
351
+			 *
352
+			 * @since 1.0.0
353
+			 */
354
+			do_action('geodir_add_listing_geocode_js_vars');
355
+			?>
356 356
             <?php if ($is_map_restrict) { ?>
357 357
             if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
358 358
                 alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
@@ -433,15 +433,15 @@  discard block
 block discarded – undo
433 433
             }
434 434
         }
435 435
         <?php
436
-        /**
437
-         * Fires when marker address updated on map.
438
-         *
439
-         * @since 1.0.0
440
-         * @param string $prefix Identifier used as a prefix for field name
441
-         */
442
-        do_action('geodir_update_marker_address', $prefix);
443
-        echo $updateMarkerAddress = ob_get_clean();
444
-        ?>
436
+		/**
437
+		 * Fires when marker address updated on map.
438
+		 *
439
+		 * @since 1.0.0
440
+		 * @param string $prefix Identifier used as a prefix for field name
441
+		 */
442
+		do_action('geodir_update_marker_address', $prefix);
443
+		echo $updateMarkerAddress = ob_get_clean();
444
+		?>
445 445
     }
446 446
     function geodir_codeAddress(set_on_map) {
447 447
         var address = jQuery('#<?php echo $prefix.'address';?>').val();
@@ -456,17 +456,17 @@  discard block
 block discarded – undo
456 456
         }
457 457
         if(!ISO2){
458 458
             <?php
459
-            if(!defined('GEODIRLOCATION_TEXTDOMAIN')){
460
-                global $wpdb;
461
-                $location_result = geodir_get_default_location();
462
-                if(!empty($location_result)){
463
-                    $ISO2 = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country=%s",$location_result->country));
464
-                    echo "ISO2 = '$ISO2';";
465
-                }
466
-            }
459
+			if(!defined('GEODIRLOCATION_TEXTDOMAIN')){
460
+				global $wpdb;
461
+				$location_result = geodir_get_default_location();
462
+				if(!empty($location_result)){
463
+					$ISO2 = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country=%s",$location_result->country));
464
+					echo "ISO2 = '$ISO2';";
465
+				}
466
+			}
467 467
 
468 468
 
469
-            ?>
469
+			?>
470 470
         }
471 471
         if (ISO2 == '--') {
472 472
             ISO2 = '';
@@ -486,9 +486,9 @@  discard block
 block discarded – undo
486 486
         }
487 487
         var is_restrict = '<?php echo $is_map_restrict; ?>';
488 488
         <?php ob_start();
489
-        $defaultregion = isset($default_location->region) ? $default_location->region : '';
490
-        $defaultcountry = isset($default_location->country) ? $default_location->country : '';
491
-        ?>
489
+		$defaultregion = isset($default_location->region) ? $default_location->region : '';
490
+		$defaultcountry = isset($default_location->country) ? $default_location->country : '';
491
+		?>
492 492
         if (set_on_map && is_restrict) {
493 493
             if (zip != '' && address != '') {
494 494
                 address = address + ',' + zip;
@@ -500,12 +500,12 @@  discard block
 block discarded – undo
500 500
             if( address == city || address == region || address == country || address == zip )
501 501
                 address = '';
502 502
             <?php
503
-            if(is_admin() && isset($_REQUEST['tab'])){?>
503
+			if(is_admin() && isset($_REQUEST['tab'])){?>
504 504
             if (jQuery.trim(city) == '' || jQuery.trim(region) == '') {
505 505
                 address = '';
506 506
             }
507 507
             <?php
508
-               }?>
508
+			   }?>
509 509
 
510 510
             if (ISO2 == 'GB') {
511 511
                 address = address + ',' + city + ',' + country; // UK is funny with regions
@@ -521,15 +521,15 @@  discard block
 block discarded – undo
521 521
             address =  address.replace(",null,", ",");
522 522
         }
523 523
         <?php $codeAddress = ob_get_clean();
524
-        /**
525
-         * Filter the address variable
526
-         *
527
-         * @since 1.0.0
528
-         *
529
-         * @param string $codeAddress Row of address to use in google map.
530
-         */
531
-        echo apply_filters('geodir_codeaddress', $codeAddress);
532
-        ?>
524
+		/**
525
+		 * Filter the address variable
526
+		 *
527
+		 * @since 1.0.0
528
+		 *
529
+		 * @param string $codeAddress Row of address to use in google map.
530
+		 */
531
+		echo apply_filters('geodir_codeaddress', $codeAddress);
532
+		?>
533 533
         if (!window.gdMaps) { // No Google Map Loaded
534 534
             return;
535 535
         }
@@ -554,13 +554,13 @@  discard block
 block discarded – undo
554 554
                         updateMarkerPosition(baseMarker.getPosition());
555 555
                         //if(set_on_map && is_restrict) {
556 556
                         <?php 
557
-                        /**
558
-                         * Fires before set geocode position.
559
-                         *
560
-                         * @since 1.0.0
561
-                         */
562
-                        do_action('geodir_add_listing_codeaddress_before_geocode');
563
-                        ?>
557
+						/**
558
+						 * Fires before set geocode position.
559
+						 *
560
+						 * @since 1.0.0
561
+						 */
562
+						do_action('geodir_add_listing_codeaddress_before_geocode');
563
+						?>
564 564
                         geocodePosition(baseMarker.getPosition(), {'address': address, 'country': ISO2});
565 565
                         //}
566 566
                     } else {
@@ -606,13 +606,13 @@  discard block
 block discarded – undo
606 606
                 updateMarkerPositionOSM(baseMarker.getLatLng());
607 607
             }
608 608
             <?php 
609
-            /**
610
-             * Fires to add javascript variable to use in google map.
611
-             *
612
-             * @since 1.0.0
613
-             */
614
-            do_action('geodir_add_listing_geocode_js_vars');
615
-            ?>
609
+			/**
610
+			 * Fires to add javascript variable to use in google map.
611
+			 *
612
+			 * @since 1.0.0
613
+			 */
614
+			do_action('geodir_add_listing_geocode_js_vars');
615
+			?>
616 616
             <?php if ($is_map_restrict) { ?>
617 617
             if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
618 618
                 alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 <?php
762 762
 $set_button_class = 'geodir_button';
763 763
 if (is_admin())
764
-    $set_button_class = 'button-primary';
764
+	$set_button_class = 'button-primary';
765 765
 ?>
766 766
 <input type="button" id="<?php echo $prefix; ?>set_address_button" class="<?php echo $set_button_class; ?>" value="<?php esc_attr_e($map_title, 'geodirectory'); ?>" style="float:none;"/>
767 767
 <div id="<?php echo $prefix; ?>d_mouseClick"></div>
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 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;
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
              *
266 266
              * @since 1.6.16
267 267
              */
268
-            echo apply_filters("geodir_geocode_region_level",'["GB","ES"]');?>;
268
+            echo apply_filters("geodir_geocode_region_level", '["GB","ES"]'); ?>;
269 269
             if (jQuery.inArray(rr, $country_arr) !== -1) {
270 270
                 if (administrative_area_level_2.long_name) {
271 271
                     getState = administrative_area_level_2.long_name;
@@ -354,9 +354,9 @@  discard block
 block discarded – undo
354 354
             do_action('geodir_add_listing_geocode_js_vars');
355 355
             ?>
356 356
             <?php if ($is_map_restrict) { ?>
357
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
358
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
359
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
357
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
358
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
359
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
360 360
                 jQuery.goMap.map.setCenter(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
361 361
                 baseMarker.setPosition(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
362 362
                 updateMarkerPosition(baseMarker.getPosition());
@@ -365,11 +365,11 @@  discard block
 block discarded – undo
365 365
             <?php } ?>
366 366
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
367 367
         } else {
368
-            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
368
+            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
369 369
         }
370 370
     }
371 371
     function centerMap(latlng) {
372
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
372
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
373 373
         if (window.gdMaps == 'google') {
374 374
             jQuery.goMap.map.panTo(baseMarker.getPosition());
375 375
         } else if (window.gdMaps == 'osm') {
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         }
379 379
     }
380 380
     function centerMarker() {
381
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
381
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
382 382
         var center = jQuery.goMap.map.getCenter();
383 383
         if (window.gdMaps == 'google') {
384 384
             baseMarker.setPosition(center);
@@ -387,48 +387,48 @@  discard block
 block discarded – undo
387 387
         }
388 388
     }
389 389
     function updateMapZoom(zoom) {
390
-        jQuery('#<?php echo $prefix.'mapzoom';?>').val(zoom);
390
+        jQuery('#<?php echo $prefix.'mapzoom'; ?>').val(zoom);
391 391
     }
392 392
     function updateMarkerPosition(markerlatLng) {
393
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
394
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat());
395
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng());
393
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
394
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat());
395
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng());
396 396
     }
397 397
     function updateMarkerPositionOSM(markerlatLng) {
398
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat);
399
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng);
398
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat);
399
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng);
400 400
     }
401 401
     function updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry) {
402
-        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields);?>';
403
-        <?php ob_start();?>
404
-        var old_country = jQuery("#<?php echo $prefix.'country';?>").val();
405
-        var old_region = jQuery("#<?php echo $prefix.'region';?>").val();
402
+        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields); ?>';
403
+        <?php ob_start(); ?>
404
+        var old_country = jQuery("#<?php echo $prefix.'country'; ?>").val();
405
+        var old_region = jQuery("#<?php echo $prefix.'region'; ?>").val();
406 406
         
407
-        if (user_address == false || jQuery('#<?php echo $prefix.'address';?>').val() == '') {
408
-            jQuery("#<?php echo $prefix.'address';?>").val(getAddress);
407
+        if (user_address == false || jQuery('#<?php echo $prefix.'address'; ?>').val() == '') {
408
+            jQuery("#<?php echo $prefix.'address'; ?>").val(getAddress);
409 409
         }
410 410
         if (getAddress) {
411 411
             oldstr_address = getAddress;
412 412
         }
413 413
 
414
-        jQuery("#<?php echo $prefix.'zip';?>").val(getZip);
414
+        jQuery("#<?php echo $prefix.'zip'; ?>").val(getZip);
415 415
         if (getZip) {
416 416
             oldstr_zip = getZip;
417 417
         }
418 418
         if (set_map_val_in_fields) {
419 419
             if (getCountry) {
420
-                jQuery('#<?php echo $prefix .'country'; ?> option[value=""]').attr("selected",false);
421
-                jQuery('#<?php echo $prefix.'country';?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
422
-                jQuery("#<?php echo $prefix.'country';?>").trigger("chosen:updated");
420
+                jQuery('#<?php echo $prefix.'country'; ?> option[value=""]').attr("selected",false);
421
+                jQuery('#<?php echo $prefix.'country'; ?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
422
+                jQuery("#<?php echo $prefix.'country'; ?>").trigger("chosen:updated");
423 423
             }
424 424
             if (getState) {
425
-                if (jQuery('input[id="<?php echo $prefix.'region';?>"]').attr('id')) {
426
-                    jQuery("#<?php echo $prefix.'region';?>").val(getState);
425
+                if (jQuery('input[id="<?php echo $prefix.'region'; ?>"]').attr('id')) {
426
+                    jQuery("#<?php echo $prefix.'region'; ?>").val(getState);
427 427
                 }
428 428
             }
429 429
             if (getCity) {
430
-                if (jQuery('input[id="<?php echo $prefix.'city';?>"]').attr('id')) {
431
-                    jQuery("#<?php echo $prefix.'city';?>").val(getCity);
430
+                if (jQuery('input[id="<?php echo $prefix.'city'; ?>"]').attr('id')) {
431
+                    jQuery("#<?php echo $prefix.'city'; ?>").val(getCity);
432 432
                 }
433 433
             }
434 434
         }
@@ -444,23 +444,23 @@  discard block
 block discarded – undo
444 444
         ?>
445 445
     }
446 446
     function geodir_codeAddress(set_on_map) {
447
-        var address = jQuery('#<?php echo $prefix.'address';?>').val();
448
-        var zip = jQuery('#<?php echo $prefix.'zip';?>').val();
449
-        var city = jQuery('#<?php echo $prefix.'city';?>').val();
450
-        var region = jQuery('#<?php echo $prefix.'region';?>').val();
451
-        var country = jQuery('#<?php echo $prefix.'country';?>').val();
452
-        var country_selected = jQuery('#<?php echo $prefix.'country';?>').find('option:selected');
447
+        var address = jQuery('#<?php echo $prefix.'address'; ?>').val();
448
+        var zip = jQuery('#<?php echo $prefix.'zip'; ?>').val();
449
+        var city = jQuery('#<?php echo $prefix.'city'; ?>').val();
450
+        var region = jQuery('#<?php echo $prefix.'region'; ?>').val();
451
+        var country = jQuery('#<?php echo $prefix.'country'; ?>').val();
452
+        var country_selected = jQuery('#<?php echo $prefix.'country'; ?>').find('option:selected');
453 453
         var ISO2 = country_selected.data('country_code');
454
-        if (!ISO2 && jQuery('#<?php echo $prefix.'country';?>').data('country_code')) {
455
-            ISO2 = jQuery('#<?php echo $prefix.'country';?>').data('country_code');
454
+        if (!ISO2 && jQuery('#<?php echo $prefix.'country'; ?>').data('country_code')) {
455
+            ISO2 = jQuery('#<?php echo $prefix.'country'; ?>').data('country_code');
456 456
         }
457 457
         if(!ISO2){
458 458
             <?php
459
-            if(!defined('GEODIRLOCATION_TEXTDOMAIN')){
459
+            if (!defined('GEODIRLOCATION_TEXTDOMAIN')) {
460 460
                 global $wpdb;
461 461
                 $location_result = geodir_get_default_location();
462
-                if(!empty($location_result)){
463
-                    $ISO2 = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country=%s",$location_result->country));
462
+                if (!empty($location_result)) {
463
+                    $ISO2 = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM ".GEODIR_COUNTRIES_TABLE." WHERE Country=%s", $location_result->country));
464 464
                     echo "ISO2 = '$ISO2';";
465 465
                 }
466 466
             }
@@ -476,13 +476,13 @@  discard block
 block discarded – undo
476 476
             zip = '';
477 477
         }
478 478
         if (typeof city == "undefined") {
479
-            city = '<?php echo addslashes_gpc($city);?>';
479
+            city = '<?php echo addslashes_gpc($city); ?>';
480 480
         }
481 481
         if (typeof region == "undefined") {
482
-            region = '<?php echo addslashes_gpc($region);?>';
482
+            region = '<?php echo addslashes_gpc($region); ?>';
483 483
         }
484 484
         if (typeof country == "undefined") {
485
-            country = '<?php echo addslashes_gpc($country);?>';
485
+            country = '<?php echo addslashes_gpc($country); ?>';
486 486
         }
487 487
         var is_restrict = '<?php echo $is_map_restrict; ?>';
488 488
         <?php ob_start();
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
             if( address == city || address == region || address == country || address == zip )
501 501
                 address = '';
502 502
             <?php
503
-            if(is_admin() && isset($_REQUEST['tab'])){?>
503
+            if (is_admin() && isset($_REQUEST['tab'])) {?>
504 504
             if (jQuery.trim(city) == '' || jQuery.trim(region) == '') {
505 505
                 address = '';
506 506
             }
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
             geocoder.geocode({'address': address, 'country': ISO2},
548 548
                 function (results, status) {
549 549
                     console.log(status);
550
-                    jQuery("#<?php echo $prefix.'map';?>").goMap();
550
+                    jQuery("#<?php echo $prefix.'map'; ?>").goMap();
551 551
                     if (status == google.maps.GeocoderStatus.OK) {
552 552
                         baseMarker.setPosition(results[0].geometry.location);
553 553
                         jQuery.goMap.map.setCenter(results[0].geometry.location);
@@ -564,21 +564,21 @@  discard block
 block discarded – undo
564 564
                         geocodePosition(baseMarker.getPosition(), {'address': address, 'country': ISO2});
565 565
                         //}
566 566
                     } else {
567
-                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:','geodirectory'));?> ' + status);
567
+                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:', 'geodirectory')); ?> ' + status);
568 568
                     }
569 569
                 });
570 570
         }
571 571
     }
572 572
     function gdMaxMap() {
573
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
573
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
574 574
 
575
-        jQuery('#<?php echo $prefix.'map';?>').toggleClass('map-fullscreen');
575
+        jQuery('#<?php echo $prefix.'map'; ?>').toggleClass('map-fullscreen');
576 576
         jQuery('.map_category').toggleClass('map_category_fullscreen');
577
-        jQuery('#<?php echo $prefix;?>trigger').toggleClass('map_category_fullscreen');
577
+        jQuery('#<?php echo $prefix; ?>trigger').toggleClass('map_category_fullscreen');
578 578
         jQuery('body').toggleClass('body_fullscreen');
579
-        jQuery('#<?php echo $prefix;?>loading_div').toggleClass('loading_div_fullscreen');
580
-        jQuery('#<?php echo $prefix;?>advmap_nofound').toggleClass('nofound_fullscreen');
581
-        jQuery('#<?php echo $prefix;?>triggermap').toggleClass('triggermap_fullscreen');
579
+        jQuery('#<?php echo $prefix; ?>loading_div').toggleClass('loading_div_fullscreen');
580
+        jQuery('#<?php echo $prefix; ?>advmap_nofound').toggleClass('nofound_fullscreen');
581
+        jQuery('#<?php echo $prefix; ?>triggermap').toggleClass('triggermap_fullscreen');
582 582
         jQuery('.TopLeft').toggleClass('TopLeft_fullscreen');
583 583
         window.setTimeout(function () {
584 584
             if (window.gdMaps == 'google') {
@@ -614,9 +614,9 @@  discard block
 block discarded – undo
614 614
             do_action('geodir_add_listing_geocode_js_vars');
615 615
             ?>
616 616
             <?php if ($is_map_restrict) { ?>
617
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
618
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
619
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
617
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
618
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
619
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
620 620
                 centerMap(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
621 621
                 baseMarker.setLatLng(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
622 622
                 updateMarkerPositionOSM(baseMarker.getLatLng());
@@ -625,39 +625,39 @@  discard block
 block discarded – undo
625 625
             <?php } ?>
626 626
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
627 627
         } else {
628
-            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
628
+            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
629 629
         }
630 630
     }
631 631
     
632 632
     jQuery(function ($) {
633
-        $("#<?php echo $prefix.'map';?>").goMap({
634
-            latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
635
-            longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
636
-            zoom: <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT,
633
+        $("#<?php echo $prefix.'map'; ?>").goMap({
634
+            latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
635
+            longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
636
+            zoom: <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT,
637 637
             maptype: 'ROADMAP', // Map type - HYBRID, ROADMAP, SATELLITE, TERRAIN
638 638
             streetViewControl: true,
639
-            <?php if(get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,';}?>
639
+            <?php if (get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,'; }?>
640 640
         });
641 641
 
642 642
         if (window.gdMaps) {
643 643
             geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : [];
644 644
 
645 645
             baseMarker = $.goMap.createMarker({
646
-                latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
647
-                longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
646
+                latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
647
+                longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
648 648
                 id: 'baseMarker',
649
-                icon: '<?php echo $marker_icon;?>',
649
+                icon: '<?php echo $marker_icon; ?>',
650 650
                 draggable: true,
651 651
                 addToMap: true, // For OSM
652
-                w: parseFloat('<?php echo $icon_size['w'];?>'),
653
-                h: parseFloat('<?php echo $icon_size['h'];?>'),
652
+                w: parseFloat('<?php echo $icon_size['w']; ?>'),
653
+                h: parseFloat('<?php echo $icon_size['h']; ?>'),
654 654
             });
655 655
         } else {
656
-            jQuery('#<?php echo $prefix.'advmap_nofound';?>').hide();
657
-            jQuery('#<?php echo $prefix.'advmap_notloaded';?>').show();
656
+            jQuery('#<?php echo $prefix.'advmap_nofound'; ?>').hide();
657
+            jQuery('#<?php echo $prefix.'advmap_notloaded'; ?>').show();
658 658
         }
659 659
         
660
-        $("#<?php echo $prefix;?>set_address_button").click(function () {
660
+        $("#<?php echo $prefix; ?>set_address_button").click(function () {
661 661
             var set_on_map = true;
662 662
             geodir_codeAddress(set_on_map);
663 663
         });
@@ -692,14 +692,14 @@  discard block
 block discarded – undo
692 692
                 updateMapZoom($.goMap.map.zoom);
693 693
             });
694 694
 
695
-            var maxMap = document.getElementById('<?php echo $prefix;?>triggermap');
695
+            var maxMap = document.getElementById('<?php echo $prefix; ?>triggermap');
696 696
             google.maps.event.addDomListener(maxMap, 'click', gdMaxMap);
697 697
 
698 698
             <?php if ($is_map_restrict) { ?>
699
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country);?>';
699
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country); ?>';
700 700
             geocoder.geocode({'address': CITY_ADDRESS},
701 701
                 function (results, status) {
702
-                    $("#<?php echo $prefix.'map';?>").goMap();
702
+                    $("#<?php echo $prefix.'map'; ?>").goMap();
703 703
                     if (status == google.maps.GeocoderStatus.OK) {
704 704
                         // Bounds for North America
705 705
                         var bound_lat_lng = String(results[0].geometry.bounds);
@@ -710,13 +710,13 @@  discard block
 block discarded – undo
710 710
                             new google.maps.LatLng(bound_lat_lng[2], bound_lat_lng[3])
711 711
                         );
712 712
                     } else {
713
-                        alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status);
713
+                        alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status);
714 714
                     }
715 715
                 });
716 716
             <?php } ?>
717 717
             // Limit the zoom level
718 718
             google.maps.event.addListener($.goMap.map, 'zoom_changed', function () {
719
-                $("#<?php echo $prefix.'map';?>").goMap();
719
+                $("#<?php echo $prefix.'map'; ?>").goMap();
720 720
                 if ($.goMap.map.getZoom() < minZoomLevel) $.goMap.map.setZoom(minZoomLevel);
721 721
             });
722 722
         } else if (window.gdMaps == 'osm') {
@@ -742,10 +742,10 @@  discard block
 block discarded – undo
742 742
                 updateMapZoom($.goMap.map.getZoom());
743 743
             });
744 744
 
745
-            L.DomEvent.addListener($('<?php echo $prefix;?>triggermap'), 'click', gdMaxMap);
745
+            L.DomEvent.addListener($('<?php echo $prefix; ?>triggermap'), 'click', gdMaxMap);
746 746
 
747 747
             <?php if ($is_map_restrict) { ?>
748
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country);?>';
748
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country); ?>';
749 749
             geocodePositionOSM('', CITY_ADDRESS);
750 750
             <?php } ?>
751 751
             // Limit the zoom level
@@ -768,14 +768,14 @@  discard block
 block discarded – undo
768 768
 <div class="top_banner_section_inn geodir_map_container clearfix" style="margin-top:10px;">
769 769
     <div class="TopLeft"><span id="<?php echo $prefix; ?>triggermap" style="margin-top:-11px;margin-left:-12px;"></span></div>
770 770
     <div class="TopRight"></div>
771
-    <div id="<?php echo $prefix . 'map'; ?>" class="geodir_map" style="height:300px">
771
+    <div id="<?php echo $prefix.'map'; ?>" class="geodir_map" style="height:300px">
772 772
         <!-- new map start -->
773 773
         <div class="iprelative">
774
-            <div id="<?php echo $prefix . 'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
774
+            <div id="<?php echo $prefix.'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
775 775
             <div id="<?php echo $prefix; ?>loading_div" style="height:300px"></div>
776 776
             <div id="<?php echo $prefix; ?>advmap_counter"></div>
777 777
             <div id="<?php echo $prefix; ?>advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
778
-            <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>
778
+            <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>
779 779
         </div>
780 780
         <!-- new map end -->
781 781
     </div>
Please login to merge, or discard this patch.