You are here

function theme_calendar_view_list in Calendar 5

Same name and namespace in other branches
  1. 5.2 calendar.theme \theme_calendar_view_list()

Display the nodes of a view as a list.

1 theme call to theme_calendar_view_list()
theme_calendar_view_calendar in ./calendar.theme
Calendar Views plugin theme, overrides default views theme to create a calendar view.

File

./calendar.theme, line 66

Code

function theme_calendar_view_list($view, $nodes, $type) {
  $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>";
        }
        $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";

    // l($node->title, "node/$node->nid");
  }
  $items = array_merge($items, (array) calendar_add_items($view, 'list'));
  if ($items) {
    return theme('item_list', $items);
  }
}