You are here

function _nodereference_item in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6 modules/nodereference/nodereference.module \_nodereference_item()
2 calls to _nodereference_item()
nodereference_autocomplete in ./nodereference.module
Retrieve a pipe delimited string of autocomplete suggestions
nodereference_widget in ./nodereference.module
Implementation of hook_widget().

File

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

Code

function _nodereference_item($field, $item, $html = TRUE) {
  if (module_exists('views') && isset($field['advanced_view']) && $field['advanced_view'] != '--' && ($view = views_get_view($field['advanced_view']))) {
    $output = theme('nodereference_item_advanced', $item, $view);
    if (!$html) {

      // Views theming runs check_plain (htmlentities) on the values.
      // We reverse that with html_entity_decode.
      $output = html_entity_decode(strip_tags($output), ENT_QUOTES);
    }
  }
  else {
    $output = theme('nodereference_item_simple', $item);
    $output = $html ? check_plain($output) : $output;
  }
  return $output;
}