You are here

function getlocations_location_taxonomize_process_address in Get Locations 7.2

Same name and namespace in other branches
  1. 7 modules/getlocations_location_taxonomize/getlocations_location_taxonomize.module \getlocations_location_taxonomize_process_address()

A #process callback function for the getlocations_fields widget Here we make note of this field in the form_state array, and add a submit callback to the form that will handle the processing.

1 string reference to 'getlocations_location_taxonomize_process_address'
getlocations_location_taxonomize_field_widget_getlocations_fields_form_alter in modules/getlocations_location_taxonomize/getlocations_location_taxonomize.module
Implements hook_field_widget_WIDGET_TYPE_form_alter(). Here we add a process callback for every widget that is set to be taxonomized

File

modules/getlocations_location_taxonomize/getlocations_location_taxonomize.module, line 97
getlocations_location_taxonomize.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_location_taxonomize_process_address($element, &$form_state, &$form) {

  // add a submit handler to forms that have this widget
  if (!in_array('getlocations_location_taxonomize_element_submitted', $form['#submit'])) {
    array_unshift($form['#submit'], 'getlocations_location_taxonomize_element_submitted');
  }

  // make note that this field needs to be processed in the submit handler
  if (!isset($form_state['temporary']['getlocations_fields']) || !in_array($element['#field_name'], $form_state['temporary']['getlocations_fields'])) {
    $form_state['temporary']['getlocations_fields'][] = $element['#field_name'];
  }
  return $element;
}