You are here

function theme_getdirections_loadaddress in Get Directions 7.3

Same name and namespace in other branches
  1. 6.2 getdirections.theme.inc \theme_getdirections_loadaddress()
  2. 7.2 getdirections.module \theme_getdirections_loadaddress()

Manipulates the address.

2 theme calls to theme_getdirections_loadaddress()
theme_getdirections_addressfield_loadaddress in ./getdirections.module
Handles addressfield
_getdirections_loadaddress in ./getdirections.module
Function to collect an address

File

./getdirections.module, line 3521
Fetches google map directions.

Code

function theme_getdirections_loadaddress($variables) {
  $location = $variables['location'];
  $addcountry = $variables['addcountry'];
  $loc = array();

  #  if (isset($location['name']) && $location['name']) {

  #    $loc[] = $location['name'];

  #  }
  if (isset($location['street']) && $location['street']) {
    $loc[] = $location['street'];
  }
  if (isset($location['additional']) && $location['additional']) {
    $loc[] = $location['additional'];
  }
  if (isset($location['city']) && $location['city']) {
    $loc[] = $location['city'];
  }
  if (isset($location['province_name']) && $location['province_name']) {
    $loc[] = $location['province_name'];
  }
  if (isset($location['postal_code']) && $location['postal_code']) {
    $loc[] = $location['postal_code'];
  }
  if ($addcountry) {
    if (isset($location['country']) && $location['country']) {
      $loc[] = drupal_strtoupper($location['country']);
    }
  }
  $output = implode(', ', $loc);
  return $output;
}