You are here

function theme_calendar_multiple_node_month in Calendar 5.2

Format an calendar day with multiple nodes for display in an expanded month calendar, like a calendar page

Parameters

$curday_date: date_format object

$count: number of events on that day

$view: The view object

File

./calendar.theme, line 617

Code

function theme_calendar_multiple_node_month($curday_date, $count, $view, $types) {

  // get the year month and date
  $parts = explode('-', substr($curday_date, 0, 10));
  $year = $parts[0];
  $month = intval($parts[1]);
  $day = intval($parts[2]);
  $max_events = variable_get('calendar_limit_' . $view->name, 5);

  // create the link to the day
  $link = $view->real_url . '/' . date_pad($year, 4) . '/' . date_pad($month) . '/' . date_pad($day);

  // mak sure the divs match the theme_calendar_node_month
  $output .= '<div class="calendar monthview">' . "\n";
  if ($view->style_max_items_behavior != 'more') {
    foreach ($types as $type) {
      $output .= theme('calendar_stripe_stripe', $type);
    }
    $item = "<div class='multiple-events'>" . l(t('Click to see all @count events', array(
      '@count' => $count,
    )), $link) . "</div>";
  }
  elseif ($count > 0) {
    $item = '<div class="calendar-more">' . l(t('more»'), $link) . '</div>';
  }
  $output .= "<div class='view-item " . views_css_safe('view-item-' . $view->name) . "'>{$item}</div>\n";
  $output .= "</div>\n";
  return $output;
}