You are here

function theme_event_node_table in Event 5.2

Same name and namespace in other branches
  1. 5 event.theme \theme_event_node_table()

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

Parameters

node: The node being displayed

File

./event.theme, line 210

Code

function theme_event_node_table($node) {
  static $stripe, $stripe_map, $link_count;
  drupal_add_js(drupal_get_path('module', 'event') . '/event.js');
  $link_count++;
  if (!$stripe_map[$node->nid]) {
    if ($stripe >= 10) {
      $stripe = 1;
    }
    else {
      $stripe++;
    }
    $stripe_map[$node->nid] = $stripe;
  }
  $output .= '<div class="event tableview vevent">' . "\n";
  $output .= '<div class="stripe-' . $stripe_map[$node->nid] . '"></div>' . "\n";
  if (variable_get('event_type_control', 'all') != 'never') {
    if (!$module && count(event_get_types('all')) + count(event_get_types('solo')) > 1) {
      $output .= '<div class="type">' . l('(' . $node->event['node_type'] . ')', 'event/' . _event_format_url($node->event['start_exploded']) . '/table/' . $node->type, array(
        'title' => t('limit view to events of this type'),
      )) . '</div>' . "\n";
    }
  }
  $output .= '<div class="title summary">' . l($node->title, "node/{$node->nid}", array(
    'title' => t('view this event'),
  )) . '</div>' . "\n";
  switch ($node->event['state']) {
    case 'singleday':
      $output .= '<div class="start dtstart" title="' . event_format_date($node->event['start'], 'custom', "Y-m-d\\TH:i:s\\Z") . '">' . t('Start: ') . $node->event['start_time_format'] . '</div>' . "\n";
      if ($node->event['start'] != $node->event['end']) {
        $output .= '<div class="end dtend" title="' . event_format_date($node->event['end'], 'custom', "Y-m-d\\TH:i:s\\Z") . '">' . t('End: ') . $node->event['end_time_format'] . '</div>' . "\n";
      }
      break;
    case 'start':
      $output .= '<div class="start dtstart" title="' . event_format_date($node->event['start'], 'custom', "Y-m-d\\TH:i:s\\Z") . '">' . t('Start: ') . $node->event['start_time_format'] . '</div>' . "\n";
      break;
    case 'end':
      $output .= '<div class="end dtend" title="' . event_format_date($node->event['end'], 'custom', "Y-m-d\\TH:i:s\\Z") . '">' . t('End: ') . $node->event['end_time_format'] . '</div>' . "\n";
      break;
    case 'allday':
    case 'ongoing':
      $output .= '<div class="ongoing">(' . t('all day') . ')</div>' . "\n";
      break;
  }
  $output .= '<div id="info_' . $link_count . '" class="info vevent">' . "\n";
  if ($node->event['state'] != 'singleday' && $node->event['state'] != 'allday') {
    $output .= '<div class="start dtstart" title="' . event_format_date($node->event['start'], 'custom', "Y-m-d\\TH:i:s\\Z") . '">' . t('Start: ') . $node->event['start_time_format'] . '</div>' . "\n";
    if ($node->event['start'] != $node->event['end']) {
      $output .= '<div class="end dtend" title="' . event_format_date($node->event['end'], 'custom', "Y-m-d\\TH:i:s\\Z") . '">' . t('End: ') . $node->event['end_time_format'] . '</div>' . "\n";
    }
  }
  $output .= '<div class="content description">' . check_markup($node->teaser, $node->format) . '</div></div>' . "\n";
  $links = $node->event['links'];
  $links['more_info'] = array(
    'title' => t('more info'),
    'href' => 'node/' . $node->nid,
    'attributes' => array(
      'onclick' => "popupnotes('info_" . $link_count . "'); return false;",
      'title' => t('Show detailed information for this event.'),
    ),
  );
  $output .= '<div class="links">' . theme('links', $links) . "\n</div>";
  $output .= '</div>' . "\n";
  return $output;
}