function theme_date_views_browser_items in Date 6
Same name and namespace in other branches
- 5.2 date/date.theme \theme_date_views_browser_items()
Alternative Date Browser Display
Display only the selected browser items instead of teasers or nodes, use for multiple date values to keep the entire teaser or node from being repeated for every multiple value of the date.
File
- date/
date.theme, line 203 - Theme functions.
Code
function theme_date_views_browser_items($view, $nodes, $type, $teasers, $links) {
$fields = _views_get_fields();
$items = array();
foreach ($nodes as $node) {
$item = '';
foreach ($view->field as $field) {
if ($fields[$field['id']]['visible'] !== FALSE) {
if ($field['label']) {
$item .= "<div class='view-label " . views_css_safe('view-label-' . $field['queryname']) . "'>" . $field['label'] . "</div>";
}
// If this is the date field, format and display the current value.
if (strstr($field['handler'], 'content_views_')) {
$field_name = explode('_value', $field['field']);
if (!empty($node->date_combo)) {
$values = explode('|', $node->date_combo);
$node_item = array(
'value' => $values[0],
'value2' => $values[1],
);
}
else {
$node_item = array(
'value' => $node->{$field}['field'],
);
}
$item .= "<div class='view-field " . views_css_safe('view-data-' . $field['queryname']) . "'>" . content_format($field_name[0], $node_item, $field['options'], $node) . "</div>";
}
else {
$item .= "<div class='view-field " . views_css_safe('view-data-' . $field['queryname']) . "'>" . views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view) . "</div>";
}
}
}
$items[] = "<div class='view-item " . views_css_safe('view-item-' . $view->name) . "'>{$item}</div>\n";
}
if ($items) {
return theme('item_list', $items);
}
}