You are here

function email_feeds_node_processor_targets_alter in Feeds 6

Implementation of hook_feeds_node_processor_targets_alter().

See also

FeedsNodeProcessor::getMappingTargets().

File

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

Code

function email_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 (in_array($field['type'], array(
        'email',
      ))) {
        $fields[$field_name] = isset($field['widget']['label']) ? $field['widget']['label'] : $field_name;
      }
    }
  }
  foreach ($fields as $k => $name) {
    $targets[$k] = array(
      'name' => check_plain($name),
      'callback' => 'email_feeds_set_target',
      'description' => t('The CCK Email @name field of the node.', array(
        '@name' => $name,
      )),
    );
  }
}