Commits

Juliette Culver committed 26cba0c

#190 Review/add RSS and iCal support, particularly for events
https://bitbucket.org/cloudengine/cloudengine/issue/190/review-add-rss-and-ical-support

Added charset to http header.
Moved headers from controller to view

Comments (0)

Files changed (2)

system/application/controllers/events.php

      */
     function ical() {
         $data['events']= $this->events_model->get_future_events();
-        header("Content-Type: text/Calendar");
-        header("Content-Disposition: inline; filename=calendar.ics");
         $this->load->view('events/ical', $data);
     }
     
         $data['page_language']    = 'en';
         $data['creator_email']    = $this->config->item('site_email'); 
 
-        header("Content-Type: application/rss+xml");
         $this->load->view('events/rss', $data);    
     }
 
      */
     function calls_ical() {
         $data['events']= $this->events_model->get_future_calls();
-        header("Content-Type: text/Calendar");
-        header("Content-Disposition: inline; filename=calendar.ics");
         $this->load->view('events/ical', $data);
     }
 
         $data['page_language']    = 'en';
         $data['creator_email']    = $this->config->item('site_email');        
 
-        header("Content-Type: application/rss+xml");
         $this->load->view('events/rss', $data);    
     }
     

system/application/views/events/ical.php

+<?php 
+  header("Content-Type: text/Calendar; charset=".config_item("charset"));
+  header("Content-Disposition: inline; filename=calendar.ics");  
+?>
 BEGIN:VCALENDAR
 VERSION:2.0
 PRODID:-//CloudEngine/<?= $this->config->item('site_name') ?>//EN