You are here

function theme_nodereference_item_advanced in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6 modules/nodereference/nodereference.module \theme_nodereference_item_advanced()
1 theme call to theme_nodereference_item_advanced()
_nodereference_item in ./nodereference.module

File

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

Code

function theme_nodereference_item_advanced($item, $view) {
  $fields = _views_get_fields();
  $item_fields = array();
  foreach ($view->field as $field) {
    $value = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $item, $view);

    // remove link tags (ex : for node titles)
    $value = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', '$1', $value);
    if (!empty($value)) {
      $item_fields[] = "<span class='view-field view-data-{$field['queryname']}'>{$value}</span>";
    }
  }
  $output = implode(' - ', $item_fields);
  $output = "<span class='view-item view-item-{$view->name}'>{$output}</span>";
  return $output;
}