You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PublicCalendarRoot.php 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Georg Ehrke <oc.list@georgehrke.com>
  6. * @author Lukas Reschke <lukas@statuscode.ch>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. * @author Thomas Citharel <nextcloud@tcit.fr>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCA\DAV\CalDAV;
  27. use OCP\IConfig;
  28. use OCP\IL10N;
  29. use Sabre\DAV\Collection;
  30. class PublicCalendarRoot extends Collection {
  31. /** @var CalDavBackend */
  32. protected $caldavBackend;
  33. /** @var \OCP\IL10N */
  34. protected $l10n;
  35. /** @var \OCP\IConfig */
  36. protected $config;
  37. /**
  38. * PublicCalendarRoot constructor.
  39. *
  40. * @param CalDavBackend $caldavBackend
  41. * @param IL10N $l10n
  42. * @param IConfig $config
  43. */
  44. function __construct(CalDavBackend $caldavBackend, IL10N $l10n,
  45. IConfig $config) {
  46. $this->caldavBackend = $caldavBackend;
  47. $this->l10n = $l10n;
  48. $this->config = $config;
  49. }
  50. /**
  51. * @inheritdoc
  52. */
  53. function getName() {
  54. return 'public-calendars';
  55. }
  56. /**
  57. * @inheritdoc
  58. */
  59. function getChild($name) {
  60. $calendar = $this->caldavBackend->getPublicCalendar($name);
  61. return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
  62. }
  63. /**
  64. * @inheritdoc
  65. */
  66. function getChildren() {
  67. return [];
  68. }
  69. }