Index: location.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/location/location.inc,v retrieving revision 1.34.2.8 diff -u -F^f -r1.34.2.8 location.inc --- location.inc 20 Oct 2006 21:41:59 -0000 1.34.2.8 +++ location.inc 1 Dec 2006 16:22:55 -0000 @@ -105,55 +105,58 @@ function theme_location($location = arra if (_location_nothing_to_show($location, $hide)) { return ''; } + $output = ''; $country_specific_function = 'theme_location_'. (isset($location['country']) ? $location['country'] : ''); if (function_exists($country_specific_function)) { - $output .= $country_specific_function($location); + $output .= $country_specific_function($location, $hide); } elseif (count($location)) { $output .= "\n"; - $output .= '
'."\n"; + $output .= '
'."\n"; if (!empty($location['name']) && !in_array('name', $hide)) { - $output .= '
'. $location['name'] .'
'; + $output .= '
'. $location['name'] .'
'; } if (!empty($location['street']) && !in_array('street', $hide)) { - $output .= '
'. $location['street'] .'
'; + $output .= '
'. $location['street']; + if (!empty($location['additional']) && !in_array('street', $hide)) { + $output .= ' ' . $location['additional']; + } + $output .='
'; } - - if (!empty($location['additional']) && !in_array('street', $hide)) { - $output .= '
' . $location['additional'] . '
'; + + if (!empty($location['city']) && !in_array('city', $hide)) { + $city_province_postal[] = $location['city']; } - - if ((!empty($location['city']) && !in_array('city', $hide)) || - (!empty($location['province']) && !in_array('province', $hide)) || - (!empty($location['postal_code']) && !in_array('postal_code', $hide))) { - $output .= '
'; - + + if ((!empty($location['city']) && !in_array('city', $hide)) || + (!empty($location['province']) && !in_array('province', $hide)) || + (!empty($location['postal_codet']) && !in_array('postal_code', $hide))) { + $city_province_postal = array(); + if (!empty($location['city']) && !in_array('city', $hide)) { - $city_province_postal[] = $location['city']; + $city_province_postal[] = '' . $location['city'] . ''; } - + if (!empty($location['province']) && !in_array('province', $hide)) { - $city_province_postal[] = $location['province']; + $city_province_postal[] = '' . $location['province'] . ''; } if (!empty($location['postal_code']) && !in_array('postal_code', $hide)) { - $city_province_postal[] = $location['postal_code']; + $city_province_postal[] = '' . $location['postal_code'] . ''; } - + $output .= implode(', ', $city_province_postal); - - $output .= '
'; } - + if (!empty($location['country']) && !in_array('country', $hide)) { $countries = _location_get_iso3166_list(); - $output .= '
'. $countries[$location['country']] . '
'; + $output .= '
'. t($countries[$location['country']]) . '
'; } - - $output .= '
'; + + $output .= ''; } $output .= location_map_link($location); Index: supported/location.de.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/location/supported/location.de.inc,v retrieving revision 1.8 diff -u -F^f -r1.8 location.de.inc --- supported/location.de.inc 18 Sep 2005 17:27:56 -0000 1.8 +++ supported/location.de.inc 1 Dec 2006 16:23:00 -0000 @@ -122,37 +122,45 @@ function _location_driving_directions_li } } -function theme_location_de($location = array()) { +function theme_location_de($location = array(), $hide = array()) { $output = ''; if (count($location)) { $output .= "\n"; - $output .= '
'."\n"; - - if (isset($location['street'])) { - $output .= '
'. $location['street'] .'
'; + $output .= '
'."\n"; + if (!empty($location['name']) && !in_array('name', $hide)) { + $output .= '
'. $location['name'] .'
'; } - - if (isset($location['additional'])) { - $output .= '
' . $location['additional'] . '
'; - } - - $postal_isset = (isset($location['postal_code']) && strlen($location['postal_code'])); - $city_isset = (isset($location['city']) && strlen($location['postal_code'])); - if ($postal_isset || $city_isset) { - $output .= '
'; - if ($postal_isset) { - $output .= $location['postal_code']; + + if (!empty($location['street']) && !in_array('street', $hide)) { + $output .= '
'. $location['street']; + if (!empty($location['additional']) && !in_array('street', $hide)) { + $output .= ' ' . $location['additional']; } - if ($postal_isset && $city_isset) { - $output .= ' '; + $output .='
'; + } + + if ((!empty($location['city']) && !in_array('city', $hide)) || + (!empty($location['postal_codet']) && !in_array('postal_code', $hide))) { + + $city_postal = array(); + + if (!empty($location['postal_code']) && !in_array('postal_code', $hide)) { + $city_postal[] = '' . $location['postal_code'] . ''; } - if ($city_isset) { - $output .= $location['city']; + + if (!empty($location['city']) && !in_array('city', $hide)) { + $city_postal[] = '' . $location['city'] . ''; } - $output .= "
\n"; + + $output .= '
'. implode(' ', $city_postal) .'
'; + } + + if (!in_array('country', $hide)) { + $output .= '
'. t('Germany') . '
'; } - - $output .= '
'. t('Germany') ."
\n"; + + $output .= '
'; + } return $output; } @@ -211,5 +219,4 @@ function location_province_list_de() { 'ST' => 'Sachsen-Anhalt', 'TH' => 'Thüringen' ); -} -?> +}