You are here

function _location_feeds_location in Location Feeds 6

Same name and namespace in other branches
  1. 7 location_feeds.module \_location_feeds_location()

Helper function to handle node and user locations

For sub elements we use the '][' construct

Parameters

$targets:

$settings:

2 calls to _location_feeds_location()
location_feeds_feeds_node_processor_targets_alter in ./location_feeds.module
Implements feeds_node_processor_target_alter().
location_feeds_feeds_user_processor_targets_alter in ./location_feeds.module
Implements feeds_user_processor_target_alter().

File

./location_feeds.module, line 65
This module provides location mappers to feed importers.

Code

function _location_feeds_location(&$targets, $settings) {
  $location_fields = _location_feeds_fields();

  // We need the collect settings
  $fields = $settings['form']['fields'];

  // locpick is a compound field. So split it
  $fields['locpick][user_latitude'] = $fields['locpick'];
  $fields['locpick][user_longitude'] = $fields['locpick'];
  unset($fields['locpick']);
  foreach ($fields as $field => $values) {
    if (!$values['collect']) {
      unset($location_fields[$field]);
    }
  }
  _location_feeds_fill_targets($targets, 'location', 'locations', $location_fields);
}