You are here

function theme_location_de in Location 5

Same name and namespace in other branches
  1. 5.3 supported/location.de.inc \theme_location_de()
  2. 6.3 supported/location.de.inc \theme_location_de()
  3. 7.5 supported/location.de.inc \theme_location_de()
  4. 7.3 supported/location.de.inc \theme_location_de()
  5. 7.4 supported/location.de.inc \theme_location_de()

File

supported/location.de.inc, line 124

Code

function theme_location_de($location = array(), $hide = array()) {
  $output = '';
  if (count($location)) {
    $output .= "\n";
    $output .= '<div class="location vcard"><div class="adr">' . "\n";
    if (!empty($location['name']) && !in_array('name', $hide)) {
      $output .= '<div class="fn">' . $location['name'] . '</div>';
    }
    if (!empty($location['street']) && !in_array('street', $hide)) {
      $output .= '<div class="street-address">' . $location['street'];
      if (!empty($location['additional']) && !in_array('street', $hide)) {
        $output .= ' ' . $location['additional'];
      }
      $output .= '</div>';
    }
    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[] = '<span class="postal-code">' . $location['postal_code'] . '</span>';
      }
      if (!empty($location['city']) && !in_array('city', $hide)) {
        $city_postal[] = '<span class="locality">' . $location['city'] . '</span>';
      }
      $output .= '<div>' . implode(' ', $city_postal) . '</div>';
    }
    if (!in_array('country', $hide)) {
      $output .= '<div class="country-name">' . t('Germany') . '</div>';
    }
    if (isset($location['latitude']) && isset($location['longitude'])) {
      $output .= '<div class="geo"><abbr class="latitude" title="' . $location['latitude'] . '" /><abbr class="longitude" title="' . $location['latitude'] . '" /></div>';
    }
    $output .= '</div></div>';
  }
  return $output;
}