function agenda()
 {
     if (!isset($this->mPermissions['agenda'])) {
         show_404();
     }
     if (!CheckPermissions($this->mPermission)) {
         return;
     }
     $this->_SetupMyCalendar();
     $this->mPaths->SetCalendarMode('agenda');
     $this->pages_model->SetPageCode('calendar_agenda');
     $date_range = array_key_exists('Range', $this->mData) ? $this->mData['Range'] : NULL;
     $filter = array_key_exists('Filter', $this->mData) ? $this->mData['Filter'] : NULL;
     if (NULL !== $date_range) {
         $this->mDateRange = $date_range;
     }
     $this->SetupCategories();
     $this->mMainSource->SetRange(time(), strtotime('2month'));
     $this->ReadFilter($this->mMainSource, $filter);
     $calendar_data = new CalendarData();
     $this->messages->AddMessages($this->mMainSource->FetchEvents($calendar_data));
     // Display data
     $this->load->library('calendar_frontend');
     $this->load->library('calendar_view_agenda');
     $agenda = new CalendarViewAgenda();
     $agenda->SetCalendarData($calendar_data);
     $agenda->SetCategories($this->mCategories);
     $data = array('Filters' => $this->GetFilters($this->mMainSource), 'ViewMode' => $agenda, 'Path' => $this->mPaths);
     $this->SetupTabs('agenda', new Academic_time(time()), $filter);
     $this->main_frame->SetContentSimple('calendar/my_calendar', $data);
     $this->main_frame->Load();
 }
 function GetAgenda(&$sources, $DateRange = NULL, $Filter = NULL, $Format = 'ac:re')
 {
     $this->mDateRange = $DateRange;
     $CI =& get_instance();
     $sources->SetRange(time(), strtotime('2month'));
     $this->ReadFilter($sources, $Filter);
     $calendar_data = new CalendarData();
     $CI->messages->AddMessages($sources->FetchEvents($calendar_data));
     // Display data
     $CI->load->library('calendar_frontend');
     $CI->load->library('calendar_view_agenda');
     $agenda = new CalendarViewAgenda();
     $agenda->SetCalendarData($calendar_data);
     $agenda->SetCategories($this->mCategories);
     $data = array('Filters' => $this->GetFilters($sources), 'ViewMode' => $agenda);
     $this->SetupTabs('agenda', new Academic_time(time()), $Filter);
     return new FramesView('calendar/my_calendar', $data);
 }