You are here

function _biblio_feeds_processor_targets_alter in Bibliography Module 7

Same name and namespace in other branches
  1. 7.2 includes/biblio.feeds.inc \_biblio_feeds_processor_targets_alter()
1 call to _biblio_feeds_processor_targets_alter()
biblio_feeds_processor_targets_alter in ./biblio.module

File

includes/biblio.feeds.inc, line 10

Code

function _biblio_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
  if ($entity_type == 'node' && $bundle_name == 'biblio') {
    $schema = drupal_get_schema('biblio');
    foreach ($schema['fields'] as $field => $spec) {
      if (strstr($field, 'biblio_')) {
        $type = $spec['type'];
        $length = isset($spec['length']) ? ' [' . $spec['length'] . ']' : '';
        $targets[$field] = array(
          'name' => $field . '  (' . $type . $length . ')',
          'description' => '',
          'callback' => '_biblio_feeds_set__simple_target',
        );
      }
    }
    $targets['biblio_type']['callback'] = '_biblio_feeds_set__type_target';
    $targets['biblio_contributor'] = array(
      'name' => t('biblio_contributor'),
      'description' => t('This is a contributor (author) contained in a biblio entry.'),
      'callback' => '_biblio_feeds_set__contrib_target',
    );
    $targets['biblio_keyword'] = array(
      'name' => t('biblio_keyword'),
      'description' => t('This is a keyword contained in a biblio entry.'),
      'callback' => '_biblio_feeds_set__keyword_target',
    );
  }
}