calendar-mini.tpl.php

Tracking 7.x-3.x branch
  1. drupal
    1. 6 contributions/calendar/calendar_multiday/theme/calendar-mini.tpl.php
    2. 6 contributions/calendar/theme/calendar-mini.tpl.php
    3. 7 contributions/calendar/theme/calendar-mini.tpl.php

Template to display a view as a mini calendar month.

$day_names: An array of the day of week names for the table header. $rows: An array of data for each day of the week. $view: The view. $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS. $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.

$show_title: If the title should be displayed. Normally false since the title is incorporated into the navigation, but sometimes needed, like in the year view of mini calendars.

See also

template_preprocess_calendar_mini.

File

View source
  1. <?php
  2. /**
  3. * @file
  4. * Template to display a view as a mini calendar month.
  5. *
  6. * @see template_preprocess_calendar_mini.
  7. *
  8. * $day_names: An array of the day of week names for the table header.
  9. * $rows: An array of data for each day of the week.
  10. * $view: The view.
  11. * $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
  12. * $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
  13. *
  14. * $show_title: If the title should be displayed. Normally false since the title is incorporated
  15. * into the navigation, but sometimes needed, like in the year view of mini calendars.
  16. *
  17. */
  18. //dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);dsm($day_names);
  19. $params = array(
  20. 'view' => $view,
  21. 'granularity' => 'month',
  22. 'link' => FALSE,
  23. );
  24. ?>
  25. <div class="calendar-calendar"><div class="month-view">
  26. <?php if ($show_title): ?>
  27. <div class="date-nav-wrapper clear-block">
  28. <div class="date-nav">
  29. <div class="date-heading">
  30. <?php print theme('date_nav_title', $params) ?>
  31. </div>
  32. </div>
  33. </div>
  34. <?php endif; ?>
  35. <table class="mini">
  36. <thead>
  37. <tr>
  38. <?php foreach ($day_names as $cell): ?>
  39. <th class="<?php print $cell['class']; ?>">
  40. <?php print $cell['data']; ?>
  41. </th>
  42. <?php endforeach; ?>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <?php foreach ((array) $rows as $row): ?>
  47. <tr>
  48. <?php foreach ($row as $cell): ?>
  49. <td id="<?php print $cell['id']; ?>" class="<?php print $cell['class']; ?>">
  50. <?php print $cell['data']; ?>
  51. </td>
  52. <?php endforeach; ?>
  53. </tr>
  54. <?php endforeach; ?>
  55. </tbody>
  56. </table>
  57. </div></div>