Projet

Général

Profil

Paste
Télécharger (4,56 ko) Statistiques
| Branche: | Révision:

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

1
<?php
2

    
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
$index = 0;
27
$header_ids = array();
28
foreach ($day_names as $key => $value) {
29
  $header_ids[$key] = $value['header_id'];
30
}
31
?>
32
<div class="calendar-calendar"><div class="week-view">
33
<table class="full">
34
  <thead>
35
    <tr>
36
      <?php if ($by_hour_count > 0 || !empty($start_times)): ?>
37
        <th class="calendar-agenda-hour"><?php print t('Time'); ?></th>
38
      <?php endif; ?>
39
      <?php foreach ($day_names as $cell): ?>
40
        <th class="<?php print $cell['class']; ?>" id="<?php print $cell['header_id']; ?>">
41
          <?php print $cell['data']; ?>
42
        </th>
43
      <?php endforeach; ?>
44
    </tr>
45
  </thead>
46
  <tbody>
47
    <?php for ($i = 0; $i < $multiday_rows; $i++): ?>
48
    <?php
49
      $colpos = 0;
50
      $rowclass = "all-day";
51
      if ($i == 0) {
52
        $rowclass .= " first";
53
      }
54
      if ($i == $multiday_rows - 1) {
55
        $rowclass .= " last";
56
      }
57
    ?>
58
    <tr class="<?php print $rowclass; ?>">
59
      <?php if ($i == 0 && ($by_hour_count > 0 || !empty($start_times))): ?>
60
      <td class="<?php print $agenda_hour_class; ?>" rowspan="<?php print $multiday_rows; ?>">
61
        <span class="calendar-hour"><?php print t('All day', array(), array('context' => 'datetime')); ?></span>
62
      </td>
63
      <?php endif; ?>
64
      <?php for ($j = 0; $j < 6; $j++): ?>
65
        <?php $cell = (empty($all_day[$j][$i])) ? NULL : $all_day[$j][$i]; ?>
66
        <?php if ($cell != NULL && $cell['filled'] && $cell['wday'] == $j): ?>
67
          <?php for ($k = $colpos; $k < $cell['wday']; $k++): ?>
68
            <td class="multi-day no-entry"><div class="inner">&nbsp;</div></td>
69
          <?php endfor; ?>
70
          <td colspan="<?php print $cell['colspan']; ?>" class="multi-day">
71
            <div class="inner">
72
              <?php print $cell['entry']; ?>
73
            </div>
74
          </td>
75
          <?php $colpos = $cell['wday'] + $cell['colspan']; ?>
76
        <?php endif; ?>
77
      <?php endfor; ?>
78
      <?php for ($j = $colpos; $j < 7; $j++): ?>
79
        <td class="multi-day no-entry"><div class="inner">&nbsp;</div></td>
80
      <?php endfor; ?>
81
    </tr>
82
    <?php endfor; ?>
83
    <?php foreach ($items as $time): ?>
84
    <tr class="not-all-day">
85
      <td class="calendar-agenda-hour">
86
        <span class="calendar-hour"><?php print $time['hour']; ?></span><span class="calendar-ampm"><?php print $time['ampm']; ?></span>
87
      </td>
88
      <?php $curpos = 0; ?>
89
      <?php foreach ($columns as $index => $column): ?>
90
        <?php $colpos = (isset($time['values'][$column][0])) ? $time['values'][$column][0]['wday'] : $index; ?>
91
        <?php for ($i = $curpos; $i < $colpos; $i++): ?>
92
        <td class="calendar-agenda-items single-day">
93
          <div class="calendar">
94
            <div class="inner">&nbsp;</div>
95
          </div>
96
        </td>
97
        <?php endfor; ?>
98
        <?php $curpos = $colpos + 1; ?>
99
        <td class="calendar-agenda-items single-day" headers="<?php print $header_ids[$index]; ?>">
100
          <div class="calendar">
101
          <div class="inner">
102
            <?php if (!empty($time['values'][$column])): ?>
103
              <?php foreach ($time['values'][$column] as $item): ?>
104
                <?php print $item['entry']; ?>
105
              <?php endforeach; ?>
106
            <?php endif; ?>
107
          </div>
108
          </div>
109
        </td>
110
      <?php endforeach; ?>
111
      <?php for ($i = $curpos; $i < 7; $i++): ?>
112
        <td class="calendar-agenda-items single-day">
113
          <div class="calendar">
114
            <div class="inner">&nbsp;</div>
115
          </div>
116
        </td>
117
      <?php endfor; ?>
118
    </tr>
119
    <?php endforeach; ?>
120
  </tbody>
121
</table>
122
</div></div>