function _ip_geoloc_set_my_location_add_selector in IP Geolocation Views & Maps 7
1 call to _ip_geoloc_set_my_location_add_selector()
- 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 545 - Blocks available in IP Geolocation Views & Maps.
Code
function _ip_geoloc_set_my_location_add_selector(&$form, &$location, $is_address_editable, $geo_vocabulary_id) {
$options = array();
$editable_address_label = variable_get('ip_geoloc_visitor_address_label', '');
$editable_region_label = variable_get('ip_geoloc_visitor_region_label', '');
if ($is_address_editable && $editable_address_label != '<none>') {
$options['1'] = $editable_address_label ? filter_xss_admin($editable_address_label) : IP_GEOLOC_VISITOR_DEFAULT_ADDRESS_LABEL;
}
if ($geo_vocabulary_id && $editable_region_label != '<none>') {
$options['2'] = $editable_region_label ? filter_xss_admin($editable_region_label) : IP_GEOLOC_VISITOR_DEFAULT_REGION_LABEL;
}
if (!empty($options)) {
$form['fixed_address'] = array(
'#type' => count($options) <= 1 ? 'markup' : 'select',
'#options' => $options,
'#default_value' => isset($options['2']) ? '2' : '1',
'#markup' => isset($options['1']) ? $options['1'] : $options['2'],
'#weight' => 5,
);
}
return $options;
}