[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/calendar/calendar_multiday/theme/ -> calendar-week-overlap.tpl.php (source)

   1  <?php
   2  // $Id: calendar-week-overlap.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 with overlapping items
   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  ?>
  31  
  32  <div class="calendar-calendar"><div class="week-view">
  33    <div id="header-container">
  34    <table class="full">
  35    <tbody>
  36      <tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
  37      <tr>
  38        <th class="calendar-agenda-hour">&nbsp;</th>
  39        <?php foreach ($day_names as $cell): ?>
  40          <th class="<?php print $cell['class']; ?>">
  41            <?php print $cell['data']; ?>
  42          </th>
  43        <?php endforeach; ?>
  44      </tr>
  45    </tbody>
  46    </table>
  47    </div>
  48    <div id="multi-day-container">
  49    <table class="full">
  50    <tbody>
  51    <tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
  52      <?php for ($i = 0; $i < $multiday_rows; $i++): ?>
  53      <?php 
  54        $colpos = 0; 
  55        $rowclass = "all-day";
  56        if( $i == 0) {
  57          $rowclass .= " first";
  58        }
  59        if( $i == $multiday_rows - 1) {
  60          $rowclass .= " last";
  61        }
  62      ?>
  63      <tr class="<?php print $rowclass?>">
  64        <?php if($i == 0 && ($by_hour_count > 0 || !empty($start_times))) :?>
  65        <td class="<?php print $agenda_hour_class ?>" rowspan="<?php print $multiday_rows?>">
  66          <span class="calendar-hour"><?php print date_t('All day', 'datetime')?></span>
  67        </td>
  68        <?php endif; ?>
  69        <?php for($j = 0; $j < 6; $j++): ?>
  70          <?php $cell = (empty($all_day[$j][$i])) ? NULL : $all_day[$j][$i]; ?>
  71          <?php if($cell != NULL && $cell['filled'] && $cell['wday'] == $j): ?>
  72            <?php for($k = $colpos; $k < $cell['wday']; $k++) : ?>
  73            <td class="calendar-agenda-items multi-day no-entry"><div class="inner">&nbsp;</div></td>
  74            <?php endfor;?>
  75            <td colspan="<?php print $cell['colspan']?>" class="calendar-agenda-items multi-day">
  76              <div class="inner">
  77              <?php print $cell['entry']?>
  78              </div>
  79            </td>
  80            <?php $colpos = $cell['wday'] + $cell['colspan']; ?>
  81          <?php endif; ?>
  82        <?php endfor; ?>  
  83        <?php for($j = $colpos; $j < 7; $j++) : ?>
  84        <td class="calendar-agenda-items multi-day no-entry"><div class="inner">&nbsp;</div></td>
  85        <?php endfor;?>
  86      </tr>
  87      <?php endfor; ?>
  88      <?php if ($multiday_rows == 0) :?>
  89      <tr>
  90        <td class="<?php print $agenda_hour_class ?>">
  91          <span class="calendar-hour"><?php print date_t('All day', 'datetime')?></span>
  92        </td>
  93        <?php for($j = 0; $j < 6; $j++): ?>
  94        <td class="calendar-agenda-items multi-day no-entry"><div class="inner">&nbsp;</div></td>
  95        <?php endfor; ?>
  96       </tr>
  97      <?php endif; ?>
  98      <tr class="expand">
  99        <td class="<?php print $agenda_hour_class ?>">
 100          <span class="calendar-hour">&nbsp;</span>
 101        </td>
 102        <?php for($j = 0; $j < 6; $j++): ?>
 103        <td class="calendar-agenda-items multi-day no-entry"><div class="inner">&nbsp;</div></td>
 104        <?php endfor; ?>
 105       </tr>
 106    </thead> 
 107    </table>
 108    </div>
 109    <div class="header-body-divider">&nbsp;</div>
 110    <div id="single-day-container">
 111      <script>
 112        try {
 113          // Hide container while it renders...  Degrade w/o javascript support
 114          $('#single-day-container').css('visibility','hidden');
 115        }catch(e){ 
 116          // swallow 
 117        }
 118      </script>
 119      <table class="full">
 120        <tbody>
 121          <tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
 122          <tr>
 123            <?php for ($index = 0; $index < 8; $index++): ?>
 124            <?php if ($index == 0 ): ?>
 125            <td class="first">
 126            <?php elseif ($index == 7 ) : ?>
 127            <td class="last">
 128            <?php else : ?>
 129            <td>
 130            <?php endif; ?>
 131              <?php foreach ($start_times as $time_cnt => $start_time): ?>
 132                <?php 
 133                  if ($time_cnt == 0) {
 134                    $class = 'first ';
 135                  }
 136                  elseif ($time_cnt == count($start_times) - 1) {
 137                    $class = 'last ';
 138                  }
 139                  else {
 140                    $class = '';
 141                  } ?>
 142                <?php if( $index == 0 ): ?>
 143                <?php $time = $items[$start_time];?>
 144                <div class="<?php print $class?>calendar-agenda-hour">
 145                  <span class="calendar-hour"><?php print $time['hour']; ?></span>
 146                  <span class="calendar-ampm"><?php print $time['ampm']; ?></span>
 147                </div>
 148                <?php else: ?>
 149                <div class="<?php print $class?>calendar-agenda-items single-day">
 150                  <div class="half-hour">&nbsp;</div>
 151                  <div class="calendar item-wrapper">
 152                    <div class="inner">
 153                      <?php if(!empty($items[$start_time]['values'][$index - 1])) :?>
 154                        <?php foreach($items[$start_time]['values'][$index - 1] as $item) :?>
 155                          <?php if (isset($item['is_first']) && $item['is_first']) :?>
 156                          <div class="item <?php print $item['class']?> first_item">
 157                          <?php else : ?>
 158                          <div class="item <?php print $item['class']?>">
 159                          <?php endif; ?>
 160                          <?php print $item['entry'] ?>
 161                          </div>
 162                        <?php endforeach; ?>
 163                      <?php endif; ?>
 164                    </div>
 165                  </div>
 166                </div>
 167                <?php endif; ?>
 168              <?php endforeach;?>
 169            </td>
 170            <?php endfor;?>
 171          </tr>
 172        </tbody>
 173      </table>
 174    </div>
 175    <div class="single-day-footer">&nbsp;</div>
 176  </div></div>
 177  <script>
 178  try {
 179    // Size and position the viewport inline so there are no delays
 180    calendar_resizeViewport();
 181    calendar_scrollToFirst();
 182  
 183    // Show it now that it is complete and positioned
 184    $('#single-day-container').css('visibility','visible');
 185  }catch(e){ 
 186    // swallow 
 187  }
 188  </script>


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7