You are here

function theme_nodereference_formatter_default in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 modules/nodereference/nodereference.module \theme_nodereference_formatter_default()
  2. 6 modules/nodereference/nodereference.module \theme_nodereference_formatter_default()

Theme function for 'default' nodereference field formatter.

1 theme call to theme_nodereference_formatter_default()
theme_nodereference_formatter_full_teaser in modules/nodereference/nodereference.module
Proxy theme function for 'full' and 'teaser' nodereference field formatters.

File

modules/nodereference/nodereference.module, line 322
Defines a field type for referencing one node from another.

Code

function theme_nodereference_formatter_default($element) {
  $output = '';
  if (!empty($element['#item']['safe']['nid'])) {
    $output = l($element['#item']['safe']['title'], 'node/' . $element['#item']['safe']['nid']);
    if (!$element['#item']['safe']['status']) {
      $output = '<span class="node-unpublished"> ' . t('(Unpublished)') . " {$output}</span>";
    }
  }
  return $output;
}