You are here

function _location_driving_directions_link_de_tinfo in Location 5

Parameters: Function that is called by location_driving_directions_link_ca() under assumption that it is the chosen function

Returns: a URL with HTTP GET variables Depending on how full the locationes are, the URL will either point to the driving directions on tinfo! or, if only partial locationes are provided, a URL that points to the *form* for tinfo! driving directions where the form is filled with whatever fields have been provided for the partial location(es).

1 call to _location_driving_directions_link_de_tinfo()
location_driving_directions_link_de in supported/location.de.inc
Parameters: -> $locationA is an associative array that represents a full location where 'street' => the street portions of the location 'supplemental' => additional street portion of the location 'province'…

File

supported/location.de.inc, line 87

Code

function _location_driving_directions_link_de_tinfo($locationA, $locationB) {
  foreach ($locationA as $field => $value) {
    $locationA[$field] = trim($value);
  }
  foreach ($locationB as $field => $value) {
    $locationB[$field] = trim($value);
  }
  if ($locationA['country'] == 'de' && $locationB['country'] == 'de') {
    $get_query = '?';
    $get_query .= 'route_input.start_country=2';
    if (isset($location['street'])) {
      $get_query .= '&' . 'route_input.start_street=' . urlencode($location['street']);
    }
    if ($location['postal_code'] != '') {
      $get_query .= '&' . 'route_input.start_zip=' . urlencode($location['postal_code']);
    }
    if ($location['city'] != '') {
      $get_query .= '&' . 'route_input.start_city_manual=' . urlencode($location['city']);
    }
    $get_query .= 'route_input.target_country=2';
    if (isset($location['street'])) {
      $get_query .= '&' . 'route_input.target_street=' . urlencode($location['street']);
    }
    if ($location['postal_code'] != '') {
      $get_query .= '&' . 'route_input.target_zip=' . urlencode($location['postal_code']);
    }
    if ($location['city'] != '') {
      $get_query .= '&' . 'route_input.target_city_manual=' . urlencode($location['city']);
    }
    return 'http://www.t-info.de/map/jumppage/route_stations.jsp' . $get_query;
  }
}