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