You are here

function location_is_empty in Location 5.3

Same name and namespace in other branches
  1. 6.3 location.module \location_is_empty()
  2. 7.5 location.module \location_is_empty()
  3. 7.3 location.module \location_is_empty()
  4. 7.4 location.module \location_is_empty()

Checks if a location is empty, and sets up an array of filled fields.

Parameters

$location The location to check.:

$filled An array (Will contain the list of filled fields upon return.):

Return value

TRUE if the location is empty, FALSE otherwise.

1 call to location_is_empty()
location_save in ./location.module
Save a location.

File

./location.module, line 1166
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;
  }

  // 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);
}