function openlayers_cck_feeds_node_processor_targets_alter in Openlayers 6
Same name and namespace in other branches
- 6.2 modules/openlayers_cck/openlayers_cck.module \openlayers_cck_feeds_node_processor_targets_alter()
Implementation of feeds_node_processor_targets_alter().
Enable mapping to openlayer_wkt fields for feeds
File
- modules/
openlayers_cck/ includes/ openlayers_cck.feeds.inc, line 16 - This file holds the Feeds module integration with the OpenLayers CCK module.
Code
function openlayers_cck_feeds_node_processor_targets_alter(&$targets, $content_type) {
$info = content_types($content_type);
$fields = array();
if (isset($info['fields']) && count($info['fields'])) {
foreach ($info['fields'] as $field_name => $field) {
if ($field['type'] == 'openlayers_wkt') {
$fields[$field_name] = isset($field['widget']['label']) ? $field['widget']['label'] : $field_name;
}
}
}
foreach ($fields as $k => $name) {
$targets[$k] = array(
'name' => $name,
'callback' => 'openlayers_cck_feeds_set_target',
'description' => t('The CCK !name field of the node.', array(
'!name' => $name,
)),
);
}
}