function geofield_feeds_processor_targets_alter in Geofield 7
Same name and namespace in other branches
- 7.2 geofield.feeds.inc \geofield_feeds_processor_targets_alter()
Implements hook_feeds_node_processor_targets_alter().
File
- ./
geofield.feeds.inc, line 69 - Provides integration with Feeds module (http://drupal.org/project/feeds)
Code
function geofield_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
$info = field_info_field($name);
if ($info['type'] == 'geofield') {
$targets[$info['field_name'] . ':wkt'] = array(
'name' => t($instance['label'] . ' WKT'),
'callback' => 'geofield_set_target_wkt',
'real_target' => $info['field_name'],
);
$targets[$info['field_name'] . ':lat'] = array(
'name' => t($instance['label'] . ' Latitude'),
'callback' => 'geofield_set_target_simple',
'real_target' => $info['field_name'],
);
$targets[$info['field_name'] . ':lon'] = array(
'name' => t($instance['label'] . ' Longitude'),
'callback' => 'geofield_set_target_simple',
'real_target' => $info['field_name'],
);
$targets[$info['field_name'] . ':left'] = array(
'name' => t($instance['label'] . ' Left Latitude'),
'callback' => 'geofield_set_target_simple',
'real_target' => $info['field_name'],
);
$targets[$info['field_name'] . ':top'] = array(
'name' => t($instance['label'] . ' Top Longitude'),
'callback' => 'geofield_set_target_simple',
'real_target' => $info['field_name'],
);
$targets[$info['field_name'] . ':right'] = array(
'name' => t($instance['label'] . ' Right Latitude'),
'callback' => 'geofield_set_target_simple',
'real_target' => $info['field_name'],
);
$targets[$info['field_name'] . ':bottom'] = array(
'name' => t($instance['label'] . ' Bottom Longitude'),
'callback' => 'geofield_set_target_simple',
'real_target' => $info['field_name'],
);
$targets[$info['field_name'] . ':combined'] = array(
'name' => t($instance['label'] . ' (combined)'),
'callback' => 'geofield_set_target_combined',
'real_target' => $info['field_name'],
);
}
}
}