root / drupal7 / sites / all / modules / calendar / theme / calendar-week.tpl.php @ 64ad485a
1 |
<?php
|
---|---|
2 |
/**
|
3 |
* @file
|
4 |
* Template to display a view as a calendar week.
|
5 |
*
|
6 |
* @see template_preprocess_calendar_week.
|
7 |
*
|
8 |
* $day_names: An array of the day of week names for the table header.
|
9 |
* $rows: The rendered data for this week.
|
10 |
*
|
11 |
* For each day of the week, you have:
|
12 |
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
13 |
* $rows['datebox'] - the formatted datebox for this day.
|
14 |
* $rows['empty'] - empty text for this day, if no items were found.
|
15 |
* $rows['all_day'] - an array of formatted all day items.
|
16 |
* $rows['items'] - an array of timed items for the day.
|
17 |
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
|
18 |
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
|
19 |
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
|
20 |
*
|
21 |
* $view: The view.
|
22 |
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
23 |
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
24 |
*
|
25 |
*/
|
26 |
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
27 |
//dsm($rows);
|
28 |
//dsm($items);
|
29 |
$index = 0; |
30 |
$header_ids = array(); |
31 |
foreach ($day_names as $key => $value) { |
32 |
$header_ids[$key] = $value['header_id']; |
33 |
} |
34 |
?>
|
35 |
<div class="calendar-calendar"><div class="week-view"> |
36 |
<table class="full"> |
37 |
<thead>
|
38 |
<tr>
|
39 |
<?php if($by_hour_count > 0 || !empty($start_times)) :?> |
40 |
<th class="calendar-agenda-hour"><?php print t('Time')?></th> |
41 |
<?php endif;?> |
42 |
<?php foreach ($day_names as $cell): ?> |
43 |
<th class="<?php print $cell['class']; ?>" id="<?php print $cell['header_id']; ?>"> |
44 |
<?php print $cell['data']; ?> |
45 |
</th>
|
46 |
<?php endforeach; ?> |
47 |
</tr>
|
48 |
</thead>
|
49 |
<tbody>
|
50 |
<?php for ($i = 0; $i < $multiday_rows; $i++): ?> |
51 |
<?php
|
52 |
$colpos = 0; |
53 |
$rowclass = "all-day"; |
54 |
if( $i == 0) { |
55 |
$rowclass .= " first"; |
56 |
} |
57 |
if( $i == $multiday_rows - 1) { |
58 |
$rowclass .= " last"; |
59 |
} |
60 |
?>
|
61 |
<tr class="<?php print $rowclass?>"> |
62 |
<?php if($i == 0 && ($by_hour_count > 0 || !empty($start_times))) :?> |
63 |
<td class="<?php print $agenda_hour_class ?>" rowspan="<?php print $multiday_rows?>"> |
64 |
<span class="calendar-hour"><?php print t('All day', array(), array('context' => 'datetime'))?></span> |
65 |
</td>
|
66 |
<?php endif; ?> |
67 |
<?php for($j = 0; $j < 6; $j++): ?> |
68 |
<?php $cell = (empty($all_day[$j][$i])) ? NULL : $all_day[$j][$i]; ?> |
69 |
<?php if($cell != NULL && $cell['filled'] && $cell['wday'] == $j): ?> |
70 |
<?php for($k = $colpos; $k < $cell['wday']; $k++) : ?> |
71 |
<td class="multi-day no-entry"><div class="inner"> </div></td> |
72 |
<?php endfor;?> |
73 |
<td colspan="<?php print $cell['colspan']?>" class="multi-day"> |
74 |
<div class="inner"> |
75 |
<?php print $cell['entry']?> |
76 |
</div>
|
77 |
</td>
|
78 |
<?php $colpos = $cell['wday'] + $cell['colspan']; ?> |
79 |
<?php endif; ?> |
80 |
<?php endfor; ?> |
81 |
<?php for($j = $colpos; $j < 7; $j++) : ?> |
82 |
<td class="multi-day no-entry"><div class="inner"> </div></td> |
83 |
<?php endfor;?> |
84 |
</tr>
|
85 |
<?php endfor; ?> |
86 |
<?php foreach ($items as $time): ?> |
87 |
<tr class="not-all-day"> |
88 |
<td class="calendar-agenda-hour"> |
89 |
<span class="calendar-hour"><?php print $time['hour']; ?></span><span class="calendar-ampm"><?php print $time['ampm']; ?></span> |
90 |
</td>
|
91 |
<?php $curpos = 0; ?> |
92 |
<?php foreach ($columns as $index => $column): ?> |
93 |
<?php $colpos = (isset($time['values'][$column][0])) ? $time['values'][$column][0]['wday'] : $index; ?> |
94 |
<?php for ($i = $curpos; $i < $colpos; $i++): ?> |
95 |
<td class="calendar-agenda-items single-day"> |
96 |
<div class="calendar"> |
97 |
<div class="inner"> </div> |
98 |
</div>
|
99 |
</td>
|
100 |
<?php endfor; ?> |
101 |
<?php $curpos = $colpos + 1;?> |
102 |
<td class="calendar-agenda-items single-day" headers="<?php print $header_ids[$index] ?>"> |
103 |
<div class="calendar"> |
104 |
<div class="inner"> |
105 |
<?php if(!empty($time['values'][$column])) :?> |
106 |
<?php foreach($time['values'][$column] as $item) :?> |
107 |
<?php print $item['entry'] ?> |
108 |
<?php endforeach; ?> |
109 |
<?php endif; ?> |
110 |
</div>
|
111 |
</div>
|
112 |
</td>
|
113 |
<?php endforeach; ?> |
114 |
<?php for ($i = $curpos; $i < 7; $i++): ?> |
115 |
<td class="calendar-agenda-items single-day"> |
116 |
<div class="calendar"> |
117 |
<div class="inner"> </div> |
118 |
</div>
|
119 |
</td>
|
120 |
<?php endfor; ?> |
121 |
</tr>
|
122 |
<?php endforeach; ?> |
123 |
</tbody>
|
124 |
</table>
|
125 |
</div></div> |