You are here

function primary_term_node_import_fields in Node import 6

Implementation of hook_node_import_fields().

File

supported/primary_term/primary_term.inc, line 43
Support file for the primary term module.

Code

function primary_term_node_import_fields($type) {
  $fields = array();

  // Import taxonomy terms for nodes.
  if (($node_type = node_import_type_is_node($type)) !== FALSE) {
    $vids = variable_get('pt_vocabs_' . $node_type, array());
    foreach ($vids as $vid) {
      $vocabulary = taxonomy_vocabulary_load($vid);
      $fields['primary_term:' . $vid] = array(
        'title' => t('Primary Term'),
        'module' => 'primary_term',
        'input_format' => 'taxonomy_term',
        'vocabulary' => $vocabulary,
        'has_multiple' => FALSE,
        'has_hierarchy' => FALSE,
      );
    }
  }
  return $fields;
}