You are here

function filefield_feeds_node_processor_targets_alter in Feeds 6

Implementation of hook_feeds_node_processor_targets_alter()

File

mappers/filefield.inc, line 14
On behalf implementation of Feeds mapping API for filefield.module (CCK).

Code

function filefield_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'] == 'filefield') {
        $name = isset($field['widget']['label']) ? $field['widget']['label'] : $field_name;
        $targets[$field_name] = array(
          'name' => check_plain($name),
          'callback' => 'filefield_feeds_set_target',
          'description' => t('The URL for the CCK @name field of the node.', array(
            '@name' => $name,
          )),
        );
      }
    }
  }
}