function theme_nodereference_item_advanced in Content Construction Kit (CCK) 6
Same name and namespace in other branches
- 5 nodereference.module \theme_nodereference_item_advanced()
1 theme call to theme_nodereference_item_advanced()
- _nodereference_item in modules/
nodereference/ nodereference.module
File
- modules/
nodereference/ nodereference.module, line 669 - Defines a field type for referencing one node from another.
Code
function theme_nodereference_item_advanced($item, $field_names, $view) {
$item_fields = array();
foreach ($item as $delta => $value) {
// 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_names[$delta]}'>{$value}</span>";
}
}
$output = implode(' - ', $item_fields);
$output = "<span class='view-item view-item-{$view->name}'>{$output}</span>";
return $output;
}