function _location_map_link_options_form in Location 5.3
Settings page for map links.
1 call to _location_map_link_options_form()
- location_map_link_options_form in ./
location.d5.inc - Callback for map link page of admin settings form.
File
- ./
location.admin.inc, line 103 - Admin forms for Location.
Code
function _location_map_link_options_form() {
$form = array();
$form['countries'] = array(
'#type' => 'markup',
'#value' => '',
);
foreach (_location_supported_countries() as $country_iso => $country_name) {
location_load_country($country_iso);
$form['countries'][$country_iso] = array(
'#type' => 'markup',
'#value' => '',
);
$form['countries'][$country_iso]['label_' . $country_iso] = array(
'#type' => 'markup',
'#value' => $country_name,
);
// Set up '#options' array for mapping providers for the current country
$mapping_options = array();
$provider_function = 'location_map_link_' . $country_iso . '_providers';
$default_provider_function = 'location_map_link_' . $country_iso . '_default_providers';
$checked = variable_get('location_map_link_' . $country_iso, function_exists($default_provider_function) ? $default_provider_function() : array());
//print "Calling provider function $provider_function";
if (function_exists($provider_function)) {
foreach ($provider_function() as $name => $details) {
$mapping_options[$name] = '<a href="' . $details['url'] . '">' . $details['name'] . '</a> (<a href="' . $details['tos'] . '">Terms of Use</a>)';
}
}
if (count($mapping_options)) {
$form['countries'][$country_iso]['location_map_link_' . $country_iso] = array(
'#title' => '',
'#type' => 'checkboxes',
'#default_value' => $checked,
'#options' => $mapping_options,
);
}
else {
$form['countries'][$country_iso]['location_map_link_' . $country_iso] = array(
'#type' => 'markup',
'#value' => t('None supported.'),
);
}
}
$form = system_settings_form($form);
$form['#theme'] = 'location_map_link_options';
return $form;
}