Projet

Général

Profil

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

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

1
<?php
2

    
3
/**
4
 * @file
5
 * Template to display a view as a calendar day, grouped by time with overlapping items.
6
 *
7
 * @see template_preprocess_calendar_day.
8
 *
9
 * $rows: The rendered data for this day.
10
 * $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
11
 * $rows['datebox'] - the formatted datebox for this day.
12
 * $rows['empty'] - empty text for this day, if no items were found.
13
 * $rows['all_day'] - an array of formatted all day items.
14
 * $rows['items'] - an array of timed items for the day.
15
 * $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
16
 * $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
17
 * $rows['items'][$time_period][$column]['values'] - An array of formatted
18
 *   items for a time period and field column.
19
 *
20
 * $view: The view.
21
 * $columns: an array of column names.
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
 * The width of the columns is dynamically set using <col></col>
26
 * based on the number of columns presented. The values passed in will
27
 * work to set the 'hour' column to 10% and split the remaining columns
28
 * evenly over the remaining 90% of the table.
29
 */
30
?>
31
<div class="calendar-calendar"><div class="day-view">
32
<div id="multi-day-container">
33
  <table class="full">
34
    <tbody>
35
      <tr class="holder">
36
        <td class="calendar-time-holder"></td>
37
        <td class="calendar-day-holder"></td>
38
      </tr>
39
      <tr>
40
        <td class="<?php print $agenda_hour_class; ?> first">
41
           <span class="calendar-hour"><?php print t('All day', array(), array('context' => 'datetime')); ?></span>
42
        </td>
43
        <td class="calendar-agenda-items multi-day last">
44
          <?php foreach ($columns as $column): ?>
45
          <div class="calendar">
46
            <div class="inner">
47
              <?php print isset($rows['all_day'][$column]) ? implode($rows['all_day'][$column]) : '&nbsp;'; ?>
48
            </div>
49
          </div>
50
          <?php endforeach; ?>
51
        </td>
52
      </tr>
53
    </tbody>
54
  </table>
55
</div>
56
<div class="header-body-divider">&nbsp;</div>
57
<div id="single-day-container">
58
  <?php if (!empty($scroll_content)): ?>
59
  <script>
60
    try {
61
        // Hide container while it renders...  Degrade w/o javascript support
62
      jQuery('#single-day-container').css('visibility','hidden');
63
    }catch(e){
64
      // swallow
65
    }
66
  </script>
67
  <?php endif; ?>
68
  <table class="full">
69
    <tbody>
70
      <tr class="holder">
71
        <td class="calendar-time-holder"></td>
72
        <td class="calendar-day-holder"></td>
73
      </tr>
74
      <tr>
75
        <td class="first">
76
          <?php $is_first = TRUE; ?>
77
          <?php foreach ($rows['items'] as $time_cnt => $hour): ?>
78
            <?php
79
              if ($time_cnt == 0) {
80
                $class = 'first ';
81
              }
82
              elseif ($time_cnt == count($start_times) - 1) {
83
                $class = 'last ';
84
              }
85
              else {
86
                $class = '';
87
              } ?>
88
            <div class="<?php print $class; ?>calendar-agenda-hour">
89
              <span class="calendar-hour"><?php print $hour['hour']; ?></span><span class="calendar-ampm"><?php print $hour['ampm']; ?></span>
90
            </div>
91
          <?php endforeach; ?>
92
        </td>
93
        <td class="last">
94
          <?php foreach ($rows['items'] as $time_cnt => $hour): ?>
95
            <?php
96
              if ($time_cnt == 0) {
97
                $class = 'first ';
98
              }
99
              elseif ($time_cnt == count($start_times) - 1) {
100
                $class = 'last ';
101
              }
102
              else {
103
                $class = '';
104
              } ?>
105
          <div class="<?php print $class; ?>calendar-agenda-items single-day">
106
            <div class="half-hour">&nbsp;</div>
107
            <?php if ($is_first && isset($hour['values'][$column])): ?>
108
            <div class="calendar item-wrapper first_item">
109
            <?php $is_first = FALSE; ?>
110
            <?php else: ?>
111
            <div class="calendar item-wrapper">
112
            <?php endif; ?>
113
              <div class="inner">
114
               <?php if (!empty($hour['values']) && is_array($hour['values']) && array_key_exists($column, $hour['values'])): ?>
115
                 <?php foreach ($hour['values'][$column] as $item): ?>
116
                   <?php print $item; ?>
117
                 <?php endforeach; ?>
118
               <?php else: ?>
119
                 <?php print '&nbsp;'; ?>
120
               <?php endif; ?>
121
              </div>
122
            </div>
123
          </div>
124
          <?php endforeach; ?>
125
        </td>
126
      </tr>
127
    </tbody>
128
  </table>
129
</div>
130
<div class="single-day-footer">&nbsp;</div>
131
</div></div>
132
<?php if (!empty($scroll_content)): ?>
133
<script>
134
try {
135
  // Size and position the viewport inline so there are no delays
136
  calendar_resizeViewport(jQuery);
137
  calendar_scrollToFirst(jQuery);
138
  jQuery('#single-day-container').css('visibility','visible');
139
}catch(e){
140
  // swallow
141
}
142
</script>
143
<?php endif; ?>