Project

General

Profile

Paste
Download (3.05 KB) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / calendar / theme / calendar-day.tpl.php @ 62e0cc08

1
<?php
2

    
3
/**
4
 * @file
5
 * Template to display a view as a calendar day, grouped by time
6
 * and optionally organized into columns by a field value.
7
 *
8
 * @see template_preprocess_calendar_day.
9
 *
10
 * $rows: The rendered data for this day.
11
 * $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
12
 * $rows['datebox'] - the formatted datebox for this day.
13
 * $rows['empty'] - empty text for this day, if no items were found.
14
 * $rows['all_day'] - an array of formatted all day items.
15
 * $rows['items'] - an array of timed items for the day.
16
 * $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
17
 * $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
18
 * $rows['items'][$time_period][$column]['values'] - An array of formatted
19
 *   items for a time period and field column.
20
 *
21
 * $view: The view.
22
 * $columns: an array of column names.
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
 * The width of the columns is dynamically set using <col></col>
27
 * based on the number of columns presented. The values passed in will
28
 * work to set the 'hour' column to 10% and split the remaining columns
29
 * evenly over the remaining 90% of the table.
30
 */
31
?>
32
<div class="calendar-calendar"><div class="day-view">
33
<table class="full">
34
  <col width="<?php print $first_column_width; ?>%"></col>
35
  <thead>
36
    <?php foreach ($columns as $column): ?>
37
    <col width="<?php print $column_width; ?>%"></col>
38
    <?php endforeach; ?>
39
    <tr>
40
      <th class="calendar-dayview-hour"><?php print $by_hour_count > 0 ? t('Time') : ''; ?></th>
41
      <?php foreach ($columns as $column): ?>
42
      <th class="calendar-agenda-items"><?php print $column; ?></th>
43
      <?php endforeach; ?>
44
    </tr>
45
  </thead>
46
  <tbody>
47
    <tr>
48
      <td class="<?php print $agenda_hour_class; ?>">
49
         <span class="calendar-hour"><?php print $by_hour_count > 0 ? t('All day', array(), array('context' => 'datetime')) : ''; ?></span>
50
       </td>
51
      <?php foreach ($columns as $column): ?>
52
       <td class="calendar-agenda-items multi-day">
53
         <div class="calendar">
54
         <div class="inner">
55
           <?php print isset($rows['all_day'][$column]) ? implode($rows['all_day'][$column]) : '&nbsp;'; ?>
56
         </div>
57
         </div>
58
       </td>
59
      <?php endforeach; ?>
60
    </tr>
61
    <?php foreach ($rows['items'] as $hour): ?>
62
    <tr>
63
      <td class="calendar-agenda-hour">
64
        <span class="calendar-hour"><?php print $hour['hour']; ?></span><span class="calendar-ampm"><?php print $hour['ampm']; ?></span>
65
      </td>
66
      <?php foreach ($columns as $column): ?>
67
        <td class="calendar-agenda-items single-day">
68
          <div class="calendar">
69
          <div class="inner">
70
            <?php print isset($hour['values'][$column]) ? implode($hour['values'][$column]) : '&nbsp;'; ?>
71
          </div>
72
          </div>
73
        </td>
74
      <?php endforeach; ?>
75
    </tr>
76
    <?php endforeach; ?>
77
  </tbody>
78
</table>
79
</div></div>