1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13: class Kronolith_FreeBusy_View_Day extends Kronolith_FreeBusy_View
14: {
15: public $view = 'day';
16:
17: protected function _title()
18: {
19: global $registry, $prefs;
20:
21: $prev = new Horde_Date($this->_start);
22: $prev->mday--;
23: $next = new Horde_Date($this->_start);
24: $next->mday++;
25: return Horde::url('#')->link(array('title' => _("Previous Day"), 'onclick' => 'return switchDate(' . $prev->dateString() . ');'))
26: . Horde::img('nav/left.png', '<')
27: . '</a>'
28: . $this->_start->strftime($prefs->getValue('date_format'))
29: . Horde::url('#')->link(array('title' => _("Next Day"), 'onclick' => 'return switchDate(' . $next->dateString() . ');'))
30: . Horde::img('nav/right.png', '>')
31: . '</a>';
32: }
33:
34: protected function _hours()
35: {
36: global $prefs;
37:
38: $hours_html = '';
39: $width = round(100 / ($this->_endHour - $this->_startHour + 1));
40: $start = new Horde_Date($this->_start);
41: $end = new Horde_Date($this->_start);
42: $end->min = 59;
43: for ($i = $this->_startHour; $i < $this->_endHour; $i++) {
44: $start->hour = $end->hour = $i;
45: $this->_timeBlocks[] = array(clone $start, clone $end);
46: $hours_html .= '<th width="' . $width . '%">' . $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00') . '</th>';
47: }
48:
49: return $hours_html;
50: }
51:
52: protected function _render(Horde_Date $day = null)
53: {
54: $this->_start = new Horde_Date($day);
55: $this->_start->hour = $this->_startHour;
56: $this->_end = new Horde_Date($this->_start);
57: $this->_end->hour = $this->_endHour;
58: }
59:
60: }
61: