public function executeIcalFeed(sfWebRequest $request) { $this->buildParams(); $this->dateRange = ''; $this->aEvent = $this->getRoute()->getObject(); $this->categories = aCategoryTable::getCategoriesForPage($this->page); $this->forward404Unless($this->aEvent); $this->forward404Unless($this->aEvent['status'] == 'published' || $this->getUser()->isAuthenticated()); aBlogItemTable::populatePages(array($this->aEvent)); header("Content-type: text/calendar"); header('Content-disposition: attachment; filename=' . str_replace('.', '-', $this->getRequest()->getHost() . '-' . $this->aEvent->id) . '.ics'); $start = $this->aEvent->getVcalStartDateTime(); $end = $this->aEvent->getVcalEndDateTime(); $title = aString::toVcal(aHtml::toPlaintext($this->aEvent->getTitle())); $body = aString::toVcal(aHtml::toPlaintext($this->aEvent->Page->getAreaText('blog-body'))); echo <<<EOM BEGIN:VCALENDAR VERSION:2.0 BEGIN:VEVENT CATEGORIES:MEETING DTSTART:{$start} DTEND:{$end} SUMMARY:{$title} DESCRIPTION:{$body} CLASS:PRIVATE END:VEVENT END:VCALENDAR EOM; exit(0); }