function getlocations_getinfo in Get Locations 7
Same name and namespace in other branches
- 7.2 getlocations.module \getlocations_getinfo()
Parameters
int $lid location id:
string entity id:
Return value
string formatted address
8 calls to getlocations_getinfo()
- getlocations_adinfo in ./
getlocations.module - Ajax callback Fetches bubble content
- getlocations_js_settings_do in ./
getlocations.module - Function sets up javascript settings
- getlocations_leaflet_entity_type_map in modules/
getlocations_leaflet/ getlocations_leaflet.module - Function
- getlocations_leaflet_field_formatter_view in modules/
getlocations_leaflet/ getlocations_leaflet.module - Implements hook_field_formatter_view(). Build a renderable array for a field value.
- getlocations_mapquest_entity_type_map in modules/
getlocations_mapquest/ getlocations_mapquest.module - Function
File
- ./
getlocations.module, line 1960 - getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function getlocations_getinfo($lid, $lidkey, $extra = FALSE) {
$content = FALSE;
if ($lid > 0) {
if (module_exists('getlocations_fields') || module_exists('location')) {
$location = getlocations_load_location($lid);
$location['nid'] = 0;
$location['uid'] = 0;
$location['tid'] = 0;
$location['cid'] = 0;
$type = getlocations_get_type_from_lid($lid);
if ($type == 'node') {
if ($nid = getlocations_get_nid_from_lid($lid)) {
$location['nid'] = $nid;
}
}
elseif ($type == 'user') {
if ($uid = getlocations_get_uid_from_lid($lid)) {
$location['uid'] = $uid;
}
}
elseif ($type == 'vocabulary' && module_exists('taxonomy')) {
if ($tid = getlocations_get_tid_from_lid($lid)) {
$location['tid'] = $tid;
}
}
elseif ($type == 'comment' && module_exists('comment')) {
if ($cid = getlocations_get_cid_from_lid($lid)) {
$location['cid'] = $cid;
}
}
}
elseif (module_exists('geofield') || module_exists('geolocation')) {
$locations = getlocations_load_locations($lid, $lidkey);
$location = $locations[0];
}
if ($extra) {
if (is_array($extra) && isset($extra['sdist'])) {
$sdist = $extra['sdist'];
$arr = explode('|', $sdist);
$sunit = $arr[0];
$slat = $arr[1];
$slon = $arr[2];
$lat = $location['latitude'];
$lon = $location['longitude'];
$latlon_a = array(
'lat' => $slat,
'lon' => $slon,
);
$latlon_b = array(
'lat' => $lat,
'lon' => $lon,
);
$dist = getlocations_distance_between($latlon_a, $latlon_b, $sunit);
$location['sdist'] = $dist['scalar'];
$location['sunit'] = $dist['distance_unit'];
}
if (is_array($extra) && isset($extra['gdlink'])) {
$location['getdirections_link'] = $extra['gdlink'];
}
}
$content = theme('getlocations_adinfo', array(
'location' => $location,
));
}
return $content;
}