You are here

function _geofield_description_formatter_text in Geofield 7

Same name and namespace in other branches
  1. 7.2 geofield.formatters.inc \_geofield_description_formatter_text()
1 call to _geofield_description_formatter_text()
_geofield_description_formatter in ./geofield.formatters.inc

File

./geofield.formatters.inc, line 424
Drupal field formatter hooks and helper functions.

Code

function _geofield_description_formatter_text($info) {
  $text = t('@shape with a center of latitude @lat and longitude @lon.', array(
    '@shape' => $info['shape'],
    '@lat' => $info['latitude'],
    '@lon' => $info['longitude'],
  ));
  if (isset($info['address'])) {
    $text .= ' ' . t('It has an approximate address of @address.', array(
      '@address' => $info['address'],
    ));
  }
  if (isset($info['area'])) {
    $text .= ' ' . t('It has an area of @area.', array(
      '@area' => $info['area'],
    ));
  }
  if (isset($info['length'])) {
    $text .= ' ' . t('It has a length of @length.', array(
      '@length' => $info['length'],
    ));
  }
  return $text;
}