protected function _hours()
{
global $prefs;
$hours_html = '';
$dayWidth = round(100 / $this->_days);
$span = floor(($this->_endHour - $this->_startHour) / 3);
if (($this->_endHour - $this->_startHour) % 3) {
$span++;
}
$date_format = $prefs->getValue('date_format');
for ($i = 0; $i < $this->_days; $i++) {
$t = new Horde_Date(array('month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$day_label = Horde::url('#')->link(array('onclick' => 'return switchDateView(\'Day\',' . $t->dateString() . ');')) . $t->strftime($date_format) . '</a>';
$hours_html .= sprintf('<th colspan="%d" width="%s%%">%s</th>', $span, $dayWidth, $day_label);
}
$hours_html .= '</tr><tr><td width="100" class="label"> </td>';
$width = round(100 / ($span * $this->_days));
for ($i = 0; $i < $this->_days; $i++) {
for ($h = $this->_startHour; $h < $this->_endHour; $h += 3) {
$start = new Horde_Date(array('hour' => $h, 'month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$end = new Horde_Date($start);
$end->hour += 2;
$end->min = 59;
$this->_timeBlocks[] = array($start, $end);
$hour = $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00');
$hours_html .= sprintf('<th width="%d%%">%s</th>', $width, $hour);
}
}
return $hours_html;
}