function getdirections_load_locations in Get Directions 7.3
Same name and namespace in other branches
- 7.2 getdirections.module \getdirections_load_locations()
Load one or more locations
Parameters
int $entity_id:
string $entity_type:
Return value
array
3 calls to getdirections_load_locations()
- getdirections_entity_setlocation in ./
getdirections.module - Function to setup the map
- getdirections_entity_setlocations in ./
getdirections.module - Function to setup the map
- getdirections_entity_setlocations_via in ./
getdirections.module - Function to setup the map to display waypoints
File
- ./
getdirections.module, line 1694 - Fetches google map directions.
Code
function getdirections_load_locations($entity_id, $entity_type) {
$locations = '';
$module = getdirections_get_current_supported_module();
if ($module == 'getlocations_fields') {
$entity_get_info = entity_get_info($entity_type);
$entity_key = $entity_get_info['entity keys']['id'];
// nid, cid, uid etc
$locations = getlocations_fields_load_locations($entity_id, $entity_key);
}
elseif ($module == 'location_node' || $module == 'location_cck') {
$entity_get_info = entity_get_info($entity_type);
$entity_key = $entity_get_info['entity keys']['id'];
// nid, cid, uid etc
$locations = location_load_locations($entity_id, $entity_key);
}
elseif ($module == 'geofield') {
$locations = getdirections_other_load_locations($entity_id, $entity_type, 'geofield');
}
elseif ($module == 'geolocation') {
$locations = getdirections_other_load_locations($entity_id, $entity_type, 'geolocation');
}
return $locations;
}