You are here

function geocoder_widget_get_link in Geocoder 7

Geocoder Widget utility function to build a link for an entity.

Ready for use in watchdog().

1 call to geocoder_widget_get_link()
geocoder_widget_get_field_value in ./geocoder.widget.inc
Get a field's value based on geocoded data.

File

./geocoder.widget.inc, line 713
geocoder.widget.inc

Code

function geocoder_widget_get_link($entity_type, $entity) {
  if ($uri_info = entity_uri($entity_type, $entity)) {
    list($id, , $bundle) = entity_extract_ids($entity_type, $entity);
    $label = t('View offending @entity_type (@bundle #@id)', array(
      '@entity_type' => $entity_type,
      '@bundle' => $bundle,
      '@id' => $id,
    ));
    return l($label, $uri_info['path'], $uri_info);
  }
  return NULL;
}