public function ical() { $ical = $this->contentLine('BEGIN', 'VCALENDAR'); $ical .= $this->contentLine('PRODID', sprintf('-//ps-webforge//Psc-CMS %s//EN', PSC::getVersion())); $ical .= $this->contentLine('VERSION', '2.0'); $ical .= $this->contentLine('CALSCALE', $this->getCalScale()); $ical .= $this->contentLine('METHOD', 'PUBLISH'); //$ical .= X-WR-CALNAME:test // http://groups.google.com/group/microformats/msg/38f97bf3caa4559e?pli=1 $ical .= $this->contentLine('X-WR-TIMEZONE', date_default_timezone_get()); $ical .= $this->contentLine('X-WR-CALDESC', NULL); $ical .= $this->icalTimezone(); foreach ($this->events as $event) { if ($event->getUID() === NULL) { $event->setUID(uniqid() . '@ps-webforge.com'); } $ical .= $event->ical(); } $ical .= $this->contentLine('END', 'VCALENDAR'); return $ical; }