You are here

function theme_calendar_ical_node in Calendar 5.2

Same name and namespace in other branches
  1. 5 calendar_ical.module \theme_calendar_ical_node()

Theme for an entire ical node.

File

./calendar_ical.module, line 354
Adds ical functionality to Calendar.

Code

function theme_calendar_ical_node($node, $view) {

  // Check plain may leave html entities in the title.
  $node->title = html_entity_decode(check_plain($node->title), ENT - QUOTES);
  $node->teaser = check_markup($node->teaser);
  if ($view->calendar_display == 'calendar') {

    // Remote nodes may come in with lengthy descriptions that won't fit
    // in small boxes of year, month, and week calendars.
    if ($view->calendar_type != 'day') {
      $node->teaser = '';
    }
    $theme = 'calendar_node_' . $view->calendar_type;
    return theme($theme, $node, $view);
  }
  else {

    // Create a pseudo node view for this item.
    $field = array();
    $output = '<div class="node">';
    $output .= '<h2>' . l($node->title, $node->url) . '</h2>';
    $output .= '<div>' . theme('calendar_date_combo', $field, $node, $node->format, t('Dates'), $view) . '</div>';
    $output .= '<div class="content">' . $node->teaser . '</div>';
    $output .= '</div>';
    return $output;
  }
}