function location_empty_location in Location 6.3
Same name and namespace in other branches
- 5.3 location.module \location_empty_location()
- 7.5 location.module \location_empty_location()
- 7.3 location.module \location_empty_location()
- 7.4 location.module \location_empty_location()
Returns an empty location object based on the given settings.
4 calls to location_empty_location()
- location_cck_widget in contrib/
location_cck/ location_cck.module - Implementation of hook_widget().
- location_is_empty in ./
location.module - Checks if a location is empty, and sets up an array of filled fields.
- location_save in ./
location.module - Save a location.
- _location_expand_location in ./
location.module - Process a location element.
File
- ./
location.module, line 1333 - Location module main routines. An implementation of a universal API for location manipulation. Provides functions for postal_code proximity searching, deep-linking into online mapping services. Currently, some options are configured through an…
Code
function location_empty_location($settings) {
$location = array();
$defaults = location_invoke_locationapi($location, 'defaults');
if (isset($settings['form']['fields'])) {
foreach ($settings['form']['fields'] as $k => $v) {
if (isset($defaults[$k])) {
$defaults[$k] = array_merge($defaults[$k], $v);
}
}
}
foreach ($defaults as $k => $v) {
if (isset($v['default'])) {
$location[$k] = $v['default'];
}
}
return $location;
}