You are here

function _ip_geoloc_set_my_location_add_address in IP Geolocation Views & Maps 7

1 call to _ip_geoloc_set_my_location_add_address()
ip_geoloc_set_location_form in ./ip_geoloc_blocks.inc
Form for finding the visitor or going to a region or street address.

File

./ip_geoloc_blocks.inc, line 568
Blocks available in IP Geolocation Views & Maps.

Code

function _ip_geoloc_set_my_location_add_address(&$form, $location) {
  $textarea = variable_get('ip_geoloc_address_element', 2);
  $address = check_plain(variable_get('ip_geoloc_visitor_address_default', ''));
  if (!empty($location['formatted_address'])) {
    $need_street = variable_get('ip_geoloc_return_address_street');
    $need_locality = variable_get('ip_geoloc_return_address_locality');
    $need_country = variable_get('ip_geoloc_return_address_country');
    $address = _ip_geoloc_custom_formatted_address($location, $need_street, $need_locality, $need_country);
  }
  $form['street_address'] = array(
    '#type' => $textarea ? 'textarea' : 'textfield',
    '#rows' => $textarea,
    '#default_value' => $address,
    '#weight' => 10,
  );
}