Project

General

Profile

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

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

1
<?php
2

    
3
/**
4
 * @file
5
 * Template to display a view as a calendar month.
6
 *
7
 * @see template_preprocess_calendar_month.
8
 *
9
 * $day_names: An array of the day of week names for the table header.
10
 * $rows: An array of data for each day of the week.
11
 * $view: The view.
12
 * $calendar_links: Array of formatted links to other calendar displays - year, month, week, day.
13
 * $display_type: year, month, day, or week.
14
 * $block: Whether or not this calendar is in a block.
15
 * $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
16
 * $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
17
 * $date_id: a css id that is unique for this date,
18
 *   it is in the form: calendar-nid-field_name-delta
19
 */
20
?>
21
<div class="calendar-calendar"><div class="month-view">
22
<table class="full">
23
  <thead>
24
    <tr>
25
      <?php foreach ($day_names as $id => $cell): ?>
26
        <th class="<?php print $cell['class']; ?>" id="<?php print $cell['header_id']; ?>">
27
          <?php print $cell['data']; ?>
28
        </th>
29
      <?php endforeach; ?>
30
    </tr>
31
  </thead>
32
  <tbody>
33
    <?php
34
      foreach ((array) $rows as $row) {
35
        print $row['data'];
36
      } ?>
37
  </tbody>
38
</table>
39
</div></div>
40
<script>
41
try {
42
  // ie hack to make the single day row expand to available space
43
  if ($.browser.msie) {
44
    var multiday_height = $('tr.multi-day')[0].clientHeight; // Height of a multi-day row
45
    $('tr[iehint]').each(function(index) {
46
      var iehint = this.getAttribute('iehint');
47
      // Add height of the multi day rows to the single day row - seems that 80% height works best
48
      var height = this.clientHeight + (multiday_height * .8 * iehint);
49
      this.style.height = height + 'px';
50
    });
51
  }
52
}catch(e){
53
  // swallow
54
}
55
</script>