You are here

function _openlayers_cck_feeds_node_processor_targets_alter in Openlayers 6.2

Private function for hook of same name.

Enable mapping to openlayer_wkt fields for feeds

1 call to _openlayers_cck_feeds_node_processor_targets_alter()
openlayers_cck_feeds_node_processor_targets_alter in modules/openlayers_cck/openlayers_cck.module
Implementation of hook_feeds_node_processor_targets_alter().

File

modules/openlayers_cck/includes/openlayers_cck.feeds.inc, line 13
File for feeds module integration

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,
      )),
    );
  }
}