You are here

function _location_node_type_save_submit in Location 6.3

Same name and namespace in other branches
  1. 5.3 location_node.module \_location_node_type_save_submit()
  2. 7.3 location_node.module \_location_node_type_save_submit()
  3. 7.4 location_node.module \_location_node_type_save_submit()

Custom submit function to save location settings properly.

1 string reference to '_location_node_type_save_submit'
location_node_form_node_type_form_alter in ./location_node.module
Alter the node_type_form form.

File

./location_node.module, line 181
Associate locations with nodes.

Code

function _location_node_type_save_submit($form, &$form_state) {
  variable_set('location_settings_node_' . $form_state['values']['type'], $form_state['values']['location_settings']);

  // @@@ Backwards compatibility variables.
  // There are a few places in contrib where these variables are checked.
  variable_set('location_maxnum_' . $form_state['values']['type'], $form_state['values']['location_settings']['multiple']['max']);
  variable_set('location_defaultnum_' . $form_state['values']['type'], $form_state['values']['location_settings']['multiple']['add']);

  // Prevent the "normal" submit handler from stomping our variable.
  unset($form_state['values']['location_settings']);
}