You are here

function _location_feeds_location in Location Feeds 7

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

Helper function to handle node and user locations

For sub elements we use the '][' construct

Parameters

$targets:

$settings:

1 call to _location_feeds_location()
location_feeds_feeds_processor_targets_alter in ./location_feeds.module
Implements feeds_node_processor_target_alter().

File

./location_feeds.module, line 61
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);
}