You are here

function theme_calendar_node_week in Calendar 5

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

Format an calendar node for display in an expanded calendar, like a calendar page

Parameters

node: The node being displayed

File

./calendar.theme, line 478

Code

function theme_calendar_node_week($node) {
  $output .= '<div class="calendar weekview">' . "\n";
  $output .= theme('calendar_stripe_stripe', $node);
  switch ($node->calendar_state) {
    case 'singleday':
      $times = '<span class="start">' . $node->start_time_format . '</span>' . "\n";
      if ($node->calendar_start != $node->calendar_end && $node->calendar_end) {
        $times .= '<span class="end"> - ' . $node->end_time_format . '</span>' . "\n";
      }
      break;
    case 'start':
      $times = '<span class="start">' . $start_label . $node->start_time_format . '</span>' . "\n";
      break;
    case 'end':
      $times = '<span class="end">' . $end_label . $node->end_time_format . '</span>' . "\n";
      break;
    case 'ongoing':
      $times = '<span class="ongoing">' . t('all day') . '</span>' . "\n";
      break;
  }
  $output .= '<div class="title">' . l($node->title, "{$node->url}", array(
    'title' => t('view this item'),
  )) . '</div>' . "\n";
  $output .= '<div class="times">' . $times . '</div>';
  $output .= '</div>' . "\n";
  return $output;
}