Index: cck_address.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/cck_address/cck_address.module,v retrieving revision 1.16 diff -u -r1.16 cck_address.module --- cck_address.module 14 Dec 2007 20:12:13 -0000 1.16 +++ cck_address.module 16 Apr 2009 17:25:04 -0000 @@ -112,6 +112,15 @@ case 'form': $activeselect = module_exists('activeselect'); $form = array(); + if (module_exists('location_node')) { + $form['location_integration'] = array( + '#type' => 'checkbox', + '#title' => t("Copy address to the node's location fields"), + '#description' => t("If a node is location enabled, overwite any location information with the location entered into this field when saving."), + '#default_value' => isset($field['location_integration']) ? $field['location_integration'] : 0, + '#return_value' => 1, + ); + } $form['state_abbrv'] = array( '#type' => 'select', '#title' => t('Display States/Provinces as'), @@ -578,7 +587,8 @@ break; case 'save': - return array('state_abbrv', + return array('location_integration', + 'state_abbrv', 'country_abbrv', 'clist', 'fielddisplay', @@ -728,6 +738,18 @@ } } } + if (module_exists('location_node') && $field['location_integration']) { + $field_name = $field['field_name']; + foreach ($node->$field_name as $delta => $item) { + if (isset($node->locations[$delta])) { + $node->locations[$delta]['street'] = $item['street1']; + $node->locations[$delta]['city'] = $item['city']; + $node->locations[$delta]['province'] = $item['state']; + $node->locations[$delta]['postal_code'] = $item['zip']; + $node->locations[$delta]['country'] = $item['country']; + } + } + } break; case 'validate': Index: README.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/cck_address/README.txt,v retrieving revision 1.5 diff -u -r1.5 README.txt --- README.txt 14 Dec 2007 20:12:13 -0000 1.5 +++ README.txt 16 Apr 2009 17:25:02 -0000 @@ -12,6 +12,7 @@ INSTALL FEATURES USAGE (Example) + LOCATION INTEGRATION THEMING UNINSTALL CREDITS @@ -115,6 +116,16 @@ This section of the module completely bypasses the regular validation and only validates against this table. Oh, except for state and country. Those use the regular tables for validation. +--LOCATION INTEGRATION-- + This module has optional integration with the Location module. This allows CCK Address to be used as a source for geo-location + lookups with a variety of online services. + + To enable integration with Location, first install and enable the Location and the Location Node modules from the Location + package. Then, enable Location integration for each content type you wish to use with CCK Address. Finally, add a CCK Address + field to your content type. When configuring it's settings, be sure to enable the "Copy address to the node's location fields" + option. If you are enabling Location integration for nodes with pre-existing address fields, they will need to be re-saved to + update their Location information. + --THEMING-- This module comes with a CSS file and implements two theme functions. I have constructed the CSS file so that two cases of display order should look okay when nodes are created/edited. The first case is the for the order listed in the 'Customize