2011-08-11 09:22:07 +00:00
|
|
|
<?php
|
2011-09-23 20:59:24 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
2011-09-22 20:22:52 +00:00
|
|
|
require_once ('../../lib/base.php');
|
2011-09-18 19:31:56 +00:00
|
|
|
OC_Util::checkLoggedIn();
|
2011-09-30 21:05:10 +00:00
|
|
|
OC_Util::checkAppEnabled('calendar');
|
2011-08-22 14:59:16 +00:00
|
|
|
// Create default calendar ...
|
2011-10-18 19:04:14 +00:00
|
|
|
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
|
2011-08-22 14:59:16 +00:00
|
|
|
if( count($calendars) == 0){
|
|
|
|
OC_Calendar_Calendar::addCalendar(OC_User::getUser(),'default','Default calendar');
|
2011-10-18 19:04:14 +00:00
|
|
|
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
|
2011-08-22 14:59:16 +00:00
|
|
|
}
|
2011-10-17 17:58:56 +00:00
|
|
|
$eventSources = array();
|
|
|
|
foreach($calendars as $calendar){
|
2011-10-19 17:07:56 +00:00
|
|
|
$eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar);
|
2011-10-17 17:58:56 +00:00
|
|
|
}
|
2011-10-17 17:34:00 +00:00
|
|
|
OC_Util::addScript('calendar', 'calendar');
|
|
|
|
OC_Util::addStyle('calendar', 'style');
|
|
|
|
OC_Util::addScript('', 'jquery.multiselect');
|
|
|
|
OC_Util::addStyle('', 'jquery.multiselect');
|
|
|
|
OC_Util::addScript('3rdparty/fullcalendar', 'fullcalendar');
|
|
|
|
OC_Util::addStyle('3rdparty/fullcalendar', 'fullcalendar');
|
|
|
|
OC_App::setActiveNavigationEntry('calendar_index');
|
2011-10-17 17:58:56 +00:00
|
|
|
$tmpl = new OC_Template('calendar', 'calendar', 'user');
|
|
|
|
$tmpl->assign('eventSources', $eventSources);
|
|
|
|
$tmpl->printPage();
|