You are here

function theme_calendar_view_nodes in Calendar 5.2

Same name and namespace in other branches
  1. 5 calendar.theme \theme_calendar_view_nodes()

Display the nodes of a view as plain nodes.

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

File

./calendar.theme, line 159

Code

function theme_calendar_view_nodes($view, $nodes, $type, $teasers = false, $links = true) {
  $output = '<div class="calendar-calendar">';
  $output .= theme('calendar_links', $view, $view->build_type != 'block');
  $output .= theme('calendar_nav', $view);
  $output .= '</div>';
  $data = array();
  foreach ($nodes as $n) {
    if (isset($n->calendar_node_theme)) {
      $theme = $n->calendar_node_theme;
      $data[] = theme($theme, $n, $view);
    }
    else {
      $node = node_load($n->nid);
      $data[] = node_view($node, $teasers, false, $links);
    }
  }
  if (!empty($data)) {
    $output .= implode($data);
  }
  else {
    $output .= views_get_textarea($view, $type, 'empty');
  }
  return $output;
}