@@ -35,19 +35,19 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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> |