2016-07-08 17:13:34 +03: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 21:18:35 +03:00
|
|
|
/** @var \OCP\IL10N */
|
|
|
|
protected $l10n;
|
|
|
|
|
2016-07-08 17:13:34 +03:00
|
|
|
function __construct(CalDavBackend $caldavBackend) {
|
|
|
|
$this->caldavBackend = $caldavBackend;
|
2016-07-31 21:18:35 +03:00
|
|
|
$this->l10n = \OC::$server->getL10N('dav');
|
2016-07-08 17:13:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
function getName() {
|
|
|
|
return 'public-calendars';
|
|
|
|
}
|
|
|
|
|
2016-07-31 21:18:35 +03:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2016-07-08 17:13:34 +03:00
|
|
|
function getChild($name) {
|
2016-08-01 17:44:28 +03:00
|
|
|
$calendar = $this->caldavBackend->getPublicCalendar($name);
|
2017-04-05 23:43:05 +03:00
|
|
|
$calendar['{http://owncloud.org/ns}owner-principal'] = '';
|
2016-08-01 17:44:28 +03:00
|
|
|
return new Calendar($this->caldavBackend, $calendar, $this->l10n);
|
2016-07-08 17:13:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
function getChildren() {
|
2017-04-05 23:43:05 +03:00
|
|
|
return [];
|
2016-07-08 17:13:34 +03:00
|
|
|
}
|
|
|
|
}
|