function field_hidden_feeds_processor_targets_alter in Field Hidden 7
Feeds module integration.
Implements hook_feeds_processor_targets_alter().
Parameters
array &$targets:
string $entity_type:
string $bundle_name:
File
- ./
field_hidden.module, line 876 - Drupal Field Hidden module
Code
function field_hidden_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
// Can't figure out how/where Feeds includes mappers, so let's make sure.
module_load_include('inc', 'feeds', 'mappers/text');
module_load_include('inc', 'feeds', 'mappers/number');
// Uses target dings for number and text types provided by Feeds self.
$types = array(
'field_hidden_text' => 'text_feeds_set_target',
'field_hidden_text_long' => 'text_feeds_set_target',
'field_hidden_integer' => 'number_feeds_set_target',
'field_hidden_decimal' => 'number_feeds_set_target',
'field_hidden_float' => 'number_feeds_set_target',
);
foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
$info = field_info_field($name);
if (array_key_exists($info['type'], $types)) {
$targets[$name] = array(
'name' => check_plain($instance['label']),
'callback' => $types[$info['type']],
'description' => t('The @label field of the entity.', array(
'@label' => $instance['label'],
)),
);
}
}
}