2016-07-08 14:13:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2017-11-06 14:56:42 +00:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2017-11-06 19:15:27 +00:00
|
|
|
* @author Georg Ehrke <oc.list@georgehrke.com>
|
2017-11-06 14:56:42 +00:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
|
|
|
* @author Thomas Citharel <tcit@tcit.fr>
|
2016-07-08 14:13:34 +00:00
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
|
|
|
*
|
|
|
|
* @license AGPL-3.0
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
namespace OCA\DAV\CalDAV;
|
|
|
|
|
2017-10-20 13:09:52 +00:00
|
|
|
use OCP\IConfig;
|
|
|
|
use OCP\IL10N;
|
2016-07-08 14:13:34 +00:00
|
|
|
use Sabre\DAV\Collection;
|
|
|
|
|
|
|
|
class PublicCalendarRoot extends Collection {
|
|
|
|
|
|
|
|
/** @var CalDavBackend */
|
|
|
|
protected $caldavBackend;
|
|
|
|
|
2016-07-31 18:18:35 +00:00
|
|
|
/** @var \OCP\IL10N */
|
|
|
|
protected $l10n;
|
|
|
|
|
2017-10-20 13:09:52 +00:00
|
|
|
/** @var \OCP\IConfig */
|
|
|
|
protected $config;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PublicCalendarRoot constructor.
|
|
|
|
*
|
|
|
|
* @param CalDavBackend $caldavBackend
|
|
|
|
* @param IL10N $l10n
|
|
|
|
* @param IConfig $config
|
|
|
|
*/
|
|
|
|
function __construct(CalDavBackend $caldavBackend, IL10N $l10n,
|
|
|
|
IConfig $config) {
|
2016-07-08 14:13:34 +00:00
|
|
|
$this->caldavBackend = $caldavBackend;
|
2017-10-20 13:09:52 +00:00
|
|
|
$this->l10n = $l10n;
|
|
|
|
$this->config = $config;
|
|
|
|
|
2016-07-08 14:13:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
function getName() {
|
|
|
|
return 'public-calendars';
|
|
|
|
}
|
|
|
|
|
2016-07-31 18:18:35 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2016-07-08 14:13:34 +00:00
|
|
|
function getChild($name) {
|
2016-08-01 14:44:28 +00:00
|
|
|
$calendar = $this->caldavBackend->getPublicCalendar($name);
|
2017-10-20 13:09:52 +00:00
|
|
|
return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
|
2016-07-08 14:13:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
function getChildren() {
|
2017-04-05 20:43:05 +00:00
|
|
|
return [];
|
2016-07-08 14:13:34 +00:00
|
|
|
}
|
|
|
|
}
|