You are here

function theme_getlocations_info in Get Locations 6

Same name and namespace in other branches
  1. 6.2 getlocations.theme.inc \theme_getlocations_info()

returns a location's vcard, requested by ajax

1 theme call to theme_getlocations_info()
getlocations_info in ./getlocations.module

File

./getlocations.theme.inc, line 104
getlocations module theming functions. using version 3 googlemaps API

Code

function theme_getlocations_info($location) {
  $output = '';
  $output .= '<div class="location vcard">';
  $output .= '<br />';
  if (!empty($location['name'])) {
    $l = $location['name'];
    if ($location['nid'] > 0) {
      $l = l($location['name'], 'node/' . $location['nid'], array(
        'attributes' => array(
          'class' => 'getlocations_infolink',
          'target' => '_parent',
        ),
      ));
    }
    elseif ($location['uid'] > 0) {

      // Use $l = $location['name'] if you don't want links to user
      $l = l($location['name'], 'user/' . $location['uid'], array(
        'attributes' => array(
          'class' => 'getlocations_infolink',
        ),
      ));
    }

    // if you are using a colorbox to display getlocations you might want to make this a plain heading
    $output .= '<h4>' . $l . '</h4>';
  }
  $output .= '<div class="adr">';
  if (!empty($location['street'])) {
    $output .= '<div class="street-address">' . $location['street'];
    if (!empty($location['additional'])) {
      $output .= ' ' . $location['additional'];
    }
    $output .= '</div>';
  }
  if (!empty($location['city'])) {
    $output .= '<span class="locality">' . $location['city'] . '</span>';
    if (!empty($location['province_name'])) {
      $output .= ",&nbsp;";
    }
  }
  if (!empty($location['province_name'])) {
    $output .= '<span class="region">' . $location['province_name'] . '</span>';
    if (!empty($location['postal_code'])) {
      $output .= "&nbsp;";
    }
  }
  if (!empty($location['postal_code'])) {
    $output .= '<span class="postal-code">' . drupal_strtoupper($location['postal_code']) . '</span>';
  }
  if (!empty($location['country_name'])) {
    $output .= '<div class="country-name">' . $location['country_name'] . '</div>';
  }
  $output .= '</div>';
  $output .= '</div>';
  return $output;
}