You are here

views-ical-vcalendar.tpl.php in Views iCal 7

File

theme/views-ical-vcalendar.tpl.php
View source
<?php

/**
 * @file
 * Default theme implementation to display an iCal calendar.
 *
 * Available variables:
 * - $title: The name of the calendar.
 * - $rows: An array of events.
 *
 * If you are editing this file, remember that all output lines generated by it
 * must end with DOS-style \r\n line endings, and not Unix-style \n, in order to
 * be compliant with the iCal spec.
 *
 * @see http://tools.ietf.org/html/rfc5545#section-3.1
 * @see date-vevent.tpl.php
 * @see date-valarm.tpl.php
 *
 * @ingroup themeable
 */
if (empty($method)) {
  $method = 'PUBLISH';
}
print "BEGIN:VCALENDAR\r\n";
print "VERSION:2.0\r\n";
print "METHOD:{$method}\r\n";
if (!empty($title)) {
  print "X-WR-CALNAME;VALUE=TEXT:{$title}\r\n";
}
print "PRODID:-//Drupal iCal API//EN\r\n";

// Note that theme('date_vevent') already has the right line endings.
foreach ($rows as $row) {
  print $row;
}
print "END:VCALENDAR\r\n";