Révision 62e0cc08
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/sites/all/modules/calendar/theme/calendar-week-overlap.tpl.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
|
|
2 | 3 |
/** |
3 | 4 |
* @file |
4 |
* Template to display a view as a calendar week with overlapping items |
|
5 |
*
|
|
5 |
* Template to display a view as a calendar week with overlapping items.
|
|
6 |
* |
|
6 | 7 |
* @see template_preprocess_calendar_week. |
7 | 8 |
* |
8 | 9 |
* $day_names: An array of the day of week names for the table header. |
9 | 10 |
* $rows: The rendered data for this week. |
10 |
*
|
|
11 |
* |
|
11 | 12 |
* For each day of the week, you have: |
12 | 13 |
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD. |
13 | 14 |
* $rows['datebox'] - the formatted datebox for this day. |
... | ... | |
17 | 18 |
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period. |
18 | 19 |
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period. |
19 | 20 |
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period. |
20 |
*
|
|
21 |
* |
|
21 | 22 |
* $view: The view. |
22 | 23 |
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS. |
23 | 24 |
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS. |
24 |
* |
|
25 | 25 |
*/ |
26 | 26 |
$header_ids = array(); |
27 | 27 |
foreach ($day_names as $key => $value) { |
28 | 28 |
$header_ids[$key] = $value['header_id']; |
29 | 29 |
} |
30 |
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted); |
|
31 | 30 |
?> |
32 |
|
|
33 | 31 |
<div class="calendar-calendar"><div class="week-view"> |
34 | 32 |
<div id="header-container"> |
35 | 33 |
<table class="full"> |
... | ... | |
52 | 50 |
<tbody> |
53 | 51 |
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr> |
54 | 52 |
<?php for ($i = 0; $i < $multiday_rows; $i++): ?> |
55 |
<?php
|
|
56 |
$colpos = 0;
|
|
53 |
<?php |
|
54 |
$colpos = 0; |
|
57 | 55 |
$rowclass = "all-day"; |
58 | 56 |
if ($i == 0) { |
59 | 57 |
$rowclass .= " first"; |
... | ... | |
72 | 70 |
<?php $cell = (empty($all_day[$j][$i])) ? NULL : $all_day[$j][$i]; ?> |
73 | 71 |
<?php if($cell != NULL && $cell['filled'] && $cell['wday'] == $j): ?> |
74 | 72 |
<?php for($colpos; $colpos < $cell['wday']; $colpos++) : ?> |
75 |
<?php
|
|
73 |
<?php |
|
76 | 74 |
$colclass = "calendar-agenda-items multi-day"; |
77 | 75 |
if ($colpos == 0) { |
78 | 76 |
$colclass .= " first"; |
... | ... | |
83 | 81 |
?> |
84 | 82 |
<td class="<?php print $colclass?>"><div class="inner"> </div></td> |
85 | 83 |
<?php endfor;?> |
86 |
<?php
|
|
84 |
<?php |
|
87 | 85 |
$colclass = "calendar-agenda-items multi-day"; |
88 | 86 |
if ($colpos == 0) { |
89 | 87 |
$colclass .= " first"; |
... | ... | |
99 | 97 |
</td> |
100 | 98 |
<?php $colpos += $cell['colspan']; ?> |
101 | 99 |
<?php endif; ?> |
102 |
<?php endfor; ?>
|
|
100 |
<?php endfor; ?> |
|
103 | 101 |
<?php while($colpos < 7) : ?> |
104 |
<?php
|
|
102 |
<?php |
|
105 | 103 |
$colclass = "calendar-agenda-items multi-day no-entry"; |
106 | 104 |
if ($colpos == 0) { |
107 | 105 |
$colclass .= " first"; |
... | ... | |
121 | 119 |
<span class="calendar-hour"><?php print t('All day', array(), array('context' => 'datetime'))?></span> |
122 | 120 |
</td> |
123 | 121 |
<?php for($j = 0; $j < 7; $j++): ?> |
124 |
<?php
|
|
122 |
<?php |
|
125 | 123 |
$colclass = "calendar-agenda-items multi-day no-entry"; |
126 | 124 |
if ($j == 0) { |
127 | 125 |
$colclass .= " first"; |
... | ... | |
139 | 137 |
<span class="calendar-hour"> </span> |
140 | 138 |
</td> |
141 | 139 |
<?php for($j = 0; $j < 7; $j++): ?> |
142 |
<?php
|
|
140 |
<?php |
|
143 | 141 |
$colclass = "calendar-agenda-items multi-day no-entry"; |
144 | 142 |
if ($j == 0) { |
145 | 143 |
$colclass .= " first"; |
... | ... | |
148 | 146 |
$colclass .= " last"; |
149 | 147 |
} |
150 | 148 |
?> |
151 |
<td class="<?php print $colclass?>"><div class="inner"> </div></td> |
|
149 |
<td class="<?php print $colclass; ?>"><div class="inner"> </div></td>
|
|
152 | 150 |
<?php endfor; ?> |
153 | 151 |
</tr> |
154 |
</thead>
|
|
152 |
</tbody>
|
|
155 | 153 |
</table> |
156 | 154 |
</div> |
157 | 155 |
<div class="header-body-divider"> </div> |
158 | 156 |
<div id="single-day-container"> |
159 |
<?php if (!empty($scroll_content)) : ?>
|
|
157 |
<?php if (!empty($scroll_content)): ?> |
|
160 | 158 |
<script> |
161 | 159 |
try { |
162 | 160 |
// Hide container while it renders... Degrade w/o javascript support |
163 | 161 |
jQuery('#single-day-container').css('visibility','hidden'); |
164 |
}catch(e){
|
|
165 |
// swallow
|
|
162 |
}catch(e){ |
|
163 |
// swallow |
|
166 | 164 |
} |
167 | 165 |
</script> |
168 | 166 |
<?php endif; ?> |
... | ... | |
171 | 169 |
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr> |
172 | 170 |
<tr> |
173 | 171 |
<?php for ($index = 0; $index < 8; $index++): ?> |
174 |
<?php if ($index == 0 ): ?>
|
|
172 |
<?php if ($index == 0): ?> |
|
175 | 173 |
<td class="first" headers="<?php print $header_ids[$index]; ?>"> |
176 |
<?php elseif ($index == 7 ) : ?>
|
|
177 |
<td class="last"">
|
|
174 |
<?php elseif ($index == 7) : ?> |
|
175 |
<td class="last"> |
|
178 | 176 |
<?php else : ?> |
179 | 177 |
<td headers="<?php print $header_ids[$index]; ?>"> |
180 | 178 |
<?php endif; ?> |
181 | 179 |
<?php foreach ($start_times as $time_cnt => $start_time): ?> |
182 |
<?php
|
|
180 |
<?php |
|
183 | 181 |
if ($time_cnt == 0) { |
184 | 182 |
$class = 'first '; |
185 | 183 |
} |
... | ... | |
189 | 187 |
else { |
190 | 188 |
$class = ''; |
191 | 189 |
} ?> |
192 |
<?php if( $index == 0 ): ?>
|
|
193 |
<?php $time = $items[$start_time];?> |
|
194 |
<div class="<?php print $class?>calendar-agenda-hour"> |
|
190 |
<?php if ($index == 0): ?>
|
|
191 |
<?php $time = $items[$start_time]; ?>
|
|
192 |
<div class="<?php print $class; ?>calendar-agenda-hour">
|
|
195 | 193 |
<span class="calendar-hour"><?php print $time['hour']; ?></span><span class="calendar-ampm"><?php print $time['ampm']; ?></span> |
196 | 194 |
</div> |
197 | 195 |
<?php else: ?> |
198 |
<div class="<?php print $class?>calendar-agenda-items single-day"> |
|
196 |
<div class="<?php print $class; ?>calendar-agenda-items single-day">
|
|
199 | 197 |
<div class="half-hour"> </div> |
200 | 198 |
<div class="calendar item-wrapper"> |
201 | 199 |
<div class="inner"> |
202 |
<?php if(!empty($items[$start_time]['values'][$index - 1])) :?>
|
|
203 |
<?php foreach($items[$start_time]['values'][$index - 1] as $item) :?>
|
|
204 |
<?php if (isset($item['is_first']) && $item['is_first']) :?>
|
|
205 |
<div class="item <?php print $item['class']?> first_item">
|
|
206 |
<?php else : ?>
|
|
207 |
<div class="item <?php print $item['class']?>">
|
|
200 |
<?php if (!empty($items[$start_time]['values'][$index - 1])): ?>
|
|
201 |
<?php foreach ($items[$start_time]['values'][$index - 1] as $item): ?>
|
|
202 |
<?php if (isset($item['is_first']) && $item['is_first']): ?>
|
|
203 |
<div class="item <?php print $item['class']; ?> first_item">
|
|
204 |
<?php else: ?> |
|
205 |
<div class="item <?php print $item['class']; ?>">
|
|
208 | 206 |
<?php endif; ?> |
209 |
<?php print $item['entry'] ?> |
|
207 |
<?php print $item['entry']; ?>
|
|
210 | 208 |
</div> |
211 | 209 |
<?php endforeach; ?> |
212 | 210 |
<?php endif; ?> |
... | ... | |
214 | 212 |
</div> |
215 | 213 |
</div> |
216 | 214 |
<?php endif; ?> |
217 |
<?php endforeach;?> |
|
215 |
<?php endforeach; ?>
|
|
218 | 216 |
</td> |
219 |
<?php endfor;?> |
|
217 |
<?php endfor; ?>
|
|
220 | 218 |
</tr> |
221 | 219 |
</tbody> |
222 | 220 |
</table> |
223 | 221 |
</div> |
224 | 222 |
<div class="single-day-footer"> </div> |
225 | 223 |
</div></div> |
226 |
<?php if (!empty($scroll_content)) : ?>
|
|
224 |
<?php if (!empty($scroll_content)): ?> |
|
227 | 225 |
<script> |
228 | 226 |
try { |
229 | 227 |
// Size and position the viewport inline so there are no delays |
... | ... | |
232 | 230 |
|
233 | 231 |
// Show it now that it is complete and positioned |
234 | 232 |
jQuery('#single-day-container').css('visibility','visible'); |
235 |
}catch(e){
|
|
236 |
// swallow
|
|
233 |
}catch(e){ |
|
234 |
// swallow |
|
237 | 235 |
} |
238 | 236 |
</script> |
239 |
<?php endif; ?> |
|
237 |
<?php endif; ?> |
Formats disponibles : Unified diff
Weekly update of contrib modules