fixed the double-display bug
parent
0b822a26cd
commit
0e7ce0624b
|
@ -42,6 +42,13 @@ if (OCP\User::isLoggedIn()) {
|
||||||
header('HTTP/1.0 404 Not Found');
|
header('HTTP/1.0 404 Not Found');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if we're being asked for something we can provide
|
||||||
|
if ($_GET['calendar_id'] !== 'shared_events') {
|
||||||
|
header('HTTP/1.0 404 Not Found');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
// get the data
|
// get the data
|
||||||
$linkItem = OCP\Share::getShareByToken(
|
$linkItem = OCP\Share::getShareByToken(
|
||||||
\OC::$session->get('public_link_token')
|
\OC::$session->get('public_link_token')
|
||||||
|
|
|
@ -20,6 +20,7 @@ $l = OCP\Util::getL10N('calendar');
|
||||||
// Get the event sources
|
// Get the event sources
|
||||||
$eventSources = array();
|
$eventSources = array();
|
||||||
|
|
||||||
|
// only for a logged-in user
|
||||||
if (OCP\User::isLoggedIn()) {
|
if (OCP\User::isLoggedIn()) {
|
||||||
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser());
|
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser());
|
||||||
foreach($calendars as $calendar) {
|
foreach($calendars as $calendar) {
|
||||||
|
@ -32,6 +33,7 @@ if (OCP\User::isLoggedIn()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is needed also when displaying a link-shared calendar
|
||||||
$events_baseURL = OCP\Util::linkTo('calendar', 'ajax/events.php');
|
$events_baseURL = OCP\Util::linkTo('calendar', 'ajax/events.php');
|
||||||
$eventSources[] = array('url' => $events_baseURL.'?calendar_id=shared_events',
|
$eventSources[] = array('url' => $events_baseURL.'?calendar_id=shared_events',
|
||||||
'backgroundColor' => '#1D2D44',
|
'backgroundColor' => '#1D2D44',
|
||||||
|
@ -39,7 +41,10 @@ $eventSources[] = array('url' => $events_baseURL.'?calendar_id=shared_events',
|
||||||
'textColor' => 'white',
|
'textColor' => 'white',
|
||||||
'editable' => 'false');
|
'editable' => 'false');
|
||||||
|
|
||||||
OCP\Util::emitHook('OC_Calendar', 'getSources', array('sources' => &$eventSources));
|
// only for a logged-in user
|
||||||
|
if (OCP\User::isLoggedIn()) {
|
||||||
|
OCP\Util::emitHook('OC_Calendar', 'getSources', array('sources' => &$eventSources));
|
||||||
|
}
|
||||||
|
|
||||||
$firstDay = null;
|
$firstDay = null;
|
||||||
$firstDayConfig = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo');
|
$firstDayConfig = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo');
|
||||||
|
|
Loading…
Reference in New Issue