2011-08-11 13:22:07 +04:00
|
|
|
<?php
|
2011-09-24 00:59:24 +04: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-23 00:22:52 +04:00
|
|
|
require_once ('../../lib/base.php');
|
2011-09-18 23:31:56 +04:00
|
|
|
OC_Util::checkLoggedIn();
|
2011-10-01 01:05:10 +04:00
|
|
|
OC_Util::checkAppEnabled('calendar');
|
2011-08-22 18:59:16 +04:00
|
|
|
// Create default calendar ...
|
|
|
|
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
|
|
|
if( count($calendars) == 0){
|
|
|
|
OC_Calendar_Calendar::addCalendar(OC_User::getUser(),'default','Default calendar');
|
|
|
|
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
|
|
|
}
|
2011-10-17 21:58:56 +04:00
|
|
|
$eventSources = array();
|
|
|
|
foreach($calendars as $calendar){
|
|
|
|
$eventSources[] = array(
|
|
|
|
'url' => 'ajax/events.php?calendar_id='.$calendar['id'],
|
2011-10-18 21:58:47 +04:00
|
|
|
'backgroundColor' => '#'.$calendar['calendarcolor'],
|
|
|
|
'borderColor' => '#888',
|
2011-10-17 21:58:56 +04:00
|
|
|
'textColor' => 'black',
|
|
|
|
);
|
|
|
|
}
|
2011-10-17 21:34:00 +04: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 21:58:56 +04:00
|
|
|
$tmpl = new OC_Template('calendar', 'calendar', 'user');
|
|
|
|
$tmpl->assign('eventSources', $eventSources);
|
|
|
|
$tmpl->printPage();
|