function location_is_empty in Location 7.3
Same name and namespace in other branches
- 5.3 location.module \location_is_empty()
- 6.3 location.module \location_is_empty()
- 7.5 location.module \location_is_empty()
- 7.4 location.module \location_is_empty()
Checks if a location is empty, and sets up an array of filled fields.
Parameters
array $location: The location to check.
array $filled: An array (Will contain the list of filled fields upon return.)
Return value
bool TRUE if the location is empty, FALSE otherwise.
2 calls to location_is_empty()
- location_cck_field_is_empty in contrib/
location_cck/ location_cck.module - Implements hook_field_is_empty().
- location_save in ./
location.module - Save a location.
File
- ./
location.module, line 1677 - 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_is_empty($location, &$filled) {
// Special case: Consider an empty array to be empty.
if (empty($location)) {
return TRUE;
}
// Special case: Consider a location with the "delete" checkbox checked to
// be empty.
if (isset($location['delete_location']) && $location['delete_location']) {
return TRUE;
}
// Patch locpick at this point.
// Otherwise, changing locpick only will not show a difference.
_location_patch_locpick($location);
$settings = isset($location['location_settings']) ? $location['location_settings'] : array();
$emptyloc = location_empty_location($settings);
return !location_calc_difference($emptyloc, $location, $filled);
}