You are here

function node_import_display_primary_term in Node import 6

Display a taxonomy term during preview.

File

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

Code

function node_import_display_primary_term($tid) {
  static $output;
  if (!isset($output)) {
    $output = array();
  }
  if (!isset($output[$tid])) {
    if ($tid === 0) {
      $output[$tid] = theme('placeholder', t('The term will be created during import'));
    }
    else {
      if ($term = taxonomy_get_term($tid)) {
        $output[$tid] = l($term->name, 'taxonomy/term/' . $tid);
      }
      else {
        $output[$tid] = theme('placeholder', $tid);
      }
    }
  }
  return $output[$tid];
}