2016-07-08 14:13:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
* @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;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2016-07-08 14:13:34 +00:00
|
|
|
function __construct(CalDavBackend $caldavBackend) {
|
|
|
|
$this->caldavBackend = $caldavBackend;
|
2016-07-31 18:18:35 +00:00
|
|
|
$this->l10n = \OC::$server->getL10N('dav');
|
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-04-09 16:51:14 +00:00
|
|
|
return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n);
|
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
|
|
|
}
|
|
|
|
}
|