first import
[projectpier.git] / library / icalendar / iCalendar.class.php
blobb572e6dea7edd540379a7600dc8fed08585804c2
1 <?php
3 class iCalendar {
5 /**
6 * Generate file
8 * @param iCalendar_Calendar $calendar One calendar of array of calendars that need to be rendered
9 * @return string
11 static function render($calendar) {
12 if(is_array($calendar)) {
13 $result = '';
14 foreach($calendar as $single_calendar) {
15 $result .= self::render($single_calendar) . "\r\n";
16 } // foreach
17 return $result;
18 } // if
20 if(!($calendar instanceof iCalendar_Calendar)) return ''; // nothing to render
22 return $calendar->render();
23 } // render
25 } // iCalendar