You are here

function ip_geoloc_pretty_print in IP Geolocation Views & Maps 7

Same name and namespace in other branches
  1. 8 ip_geoloc.module \ip_geoloc_pretty_print()

Print the location array nicely.

Parameters

array $location: Array of location components.

Return value

string The location array formatted as string.

5 calls to ip_geoloc_pretty_print()
ip_geoloc_current_location_ajax_recipient in ./ip_geoloc.module
Data recipient for javascript function getLocation().
ip_geoloc_set_location_from_address in ./ip_geoloc_blocks.inc
Returns the supplied string into an array with various address components.
ip_geoloc_smart_ip_get_location_alter in ./ip_geoloc.module
Implements hook_smart_ip_get_location_alter().
ip_geoloc_store_location in ./ip_geoloc_api.inc
Store the supplied IP geolocation info on the database.
ip_geoloc_use_geoip_api_if_enabled in ./ip_geoloc.module
Module GeoIP API does not expose a hook, but it does expose an API.

File

./ip_geoloc.module, line 624
IPGV&M is a mapping engine for Views that contain locations of entities and/or visitors. Google Maps, Leaflet and OpenLayers2 maps are all supported. and available through this module. Using a number of optional sources IPGV&M also retrieves…

Code

function ip_geoloc_pretty_print($location) {
  $t = '';
  foreach ($location as $label => $value) {
    if (!empty($value)) {
      $t .= check_plain($label) . ':&nbsp;<strong>' . check_plain($value) . '</strong>&nbsp; ';
    }
  }
  return empty($t) ? t('nothing') : $t;
}