2016-07-08 17:13:34 +03:00
|
|
|
<?php
|
|
|
|
/**
|
2017-11-06 17:56:42 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2020-04-29 12:57:22 +03:00
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
2017-11-06 22:15:27 +03:00
|
|
|
* @author Georg Ehrke <oc.list@georgehrke.com>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
2020-03-31 11:49:10 +03:00
|
|
|
* @author Thomas Citharel <nextcloud@tcit.fr>
|
2016-07-08 17:13:34 +03: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,
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
2016-07-08 17:13:34 +03:00
|
|
|
*
|
|
|
|
*/
|
2019-11-22 22:52:10 +03:00
|
|
|
|
2016-07-08 17:13:34 +03:00
|
|
|
namespace OCA\DAV\CalDAV;
|
|
|
|
|
2017-10-20 16:09:52 +03:00
|
|
|
use OCP\IConfig;
|
|
|
|
use OCP\IL10N;
|
2016-07-08 17:13:34 +03:00
|
|
|
use Sabre\DAV\Collection;
|
|
|
|
|
|
|
|
class PublicCalendarRoot extends Collection {
|
|
|
|
|
|
|
|
/** @var CalDavBackend */
|
|
|
|
protected $caldavBackend;
|
|
|
|
|
2016-07-31 21:18:35 +03:00
|
|
|
/** @var \OCP\IL10N */
|
|
|
|
protected $l10n;
|
|
|
|
|
2017-10-20 16:09:52 +03:00
|
|
|
/** @var \OCP\IConfig */
|
|
|
|
protected $config;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PublicCalendarRoot constructor.
|
|
|
|
*
|
|
|
|
* @param CalDavBackend $caldavBackend
|
|
|
|
* @param IL10N $l10n
|
|
|
|
* @param IConfig $config
|
|
|
|
*/
|
2020-04-10 17:51:06 +03:00
|
|
|
public function __construct(CalDavBackend $caldavBackend, IL10N $l10n,
|
2017-10-20 16:09:52 +03:00
|
|
|
IConfig $config) {
|
2016-07-08 17:13:34 +03:00
|
|
|
$this->caldavBackend = $caldavBackend;
|
2017-10-20 16:09:52 +03:00
|
|
|
$this->l10n = $l10n;
|
|
|
|
$this->config = $config;
|
2016-07-08 17:13:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2020-04-10 17:51:06 +03:00
|
|
|
public function getName() {
|
2016-07-08 17:13:34 +03:00
|
|
|
return 'public-calendars';
|
|
|
|
}
|
|
|
|
|
2016-07-31 21:18:35 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2020-04-10 17:51:06 +03:00
|
|
|
public function getChild($name) {
|
2016-08-01 17:44:28 +03:00
|
|
|
$calendar = $this->caldavBackend->getPublicCalendar($name);
|
2017-10-20 16:09:52 +03:00
|
|
|
return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
|
2016-07-08 17:13:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2020-04-10 17:51:06 +03:00
|
|
|
public function getChildren() {
|
2017-04-05 23:43:05 +03:00
|
|
|
return [];
|
2016-07-08 17:13:34 +03:00
|
|
|
}
|
|
|
|
}
|