function location_addanother_form_node_type_form_alter in Location 7.3
Same name and namespace in other branches
- 7.5 contrib/location_addanother/location_addanother.module \location_addanother_form_node_type_form_alter()
Implements hook_form_FORM_ID_alter().
Alter the node_type_form form.
File
- contrib/
location_addanother/ location_addanother.module, line 41 - "Add location from node view" functionality. Split from main location.module in version 3.
Code
function location_addanother_form_node_type_form_alter(&$form, &$form_state, $form_id) {
// Load the content type's location settings to see if addanother is enabled.
$settings = variable_get('location_settings_node_' . $form['#node_type']->type, array());
$is_enabled = isset($settings['multiple']['location_addanother']) ? $settings['multiple']['location_addanother'] : 0;
$form['location_settings']['multiple']['location_addanother'] = array(
'#type' => 'checkbox',
'#title' => t('Add another location from node view page'),
'#default_value' => $is_enabled,
'#description' => t('Display the "Add another location" option on the node view page.'),
);
}