';
}
$date_ob = new Kronolith_Day($month, $day, $year);
if ($date_ob->isToday()) {
$td_class = 'kronolith-today';
} elseif ($date_ob->month != $month) {
$td_class = 'kronolith-othermonth';
} elseif ($date_ob->dayOfWeek() == 0 || $date_ob->dayOfWeek() == 6) {
$td_class = 'kronolith-weekend';
} else {
$td_class = '';
}
$html .= '';
/* Set up the link to the day view. */
$url = Horde::url('day.php', true)
->add('date', $date_ob->dateString());
if (isset($this->_params['calendar']) &&
$this->_params['calendar'] != '__all') {
$url->add('display_cal', $this->_params['calendar']);
}
$date_stamp = $date_ob->dateString();
if (empty($all_events[$date_stamp])) {
/* No events, plain link to the day. */
$cell = Horde::linkTooltip($url, _("View Day")) . $date_ob->mday . '';
} else {
/* There are events; create a cell with tooltip to
* list them. */
$day_events = '';
foreach ($all_events[$date_stamp] as $event) {
if ($event->isAllDay()) {
$day_events .= _("All day");
} else {
$day_events .= $event->start->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p') . '-' . $event->end->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p');
}
$location = $event->getLocation();
$day_events .= ':'
. ($location ? ' (' . htmlspecialchars($location) . ')' : '')
. ' ' . $event->getTitle() . "\n";
}
$cell = Horde::linkTooltip($url, _("View Day"), '', '', '', $day_events) . $date_ob->mday . '';
}
/* Bold the cell if there are events. */
if (!empty($all_events[$date_stamp])) {
$cell = '' . $cell . '';
}
$html .= $cell . ' | ';
++$weekday;
}
return $html . '