CalDAVSettings.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * @copyright 2017, Georg Ehrke <oc.list@georgehrke.com>
  4. *
  5. * @author Georg Ehrke <oc.list@georgehrke.com>
  6. * @author Julius Härtl <jus@bitgrid.net>
  7. * @author Thomas Citharel <nextcloud@tcit.fr>
  8. *
  9. * @license GNU AGPL version 3 or any later version
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License as
  13. * published by the Free Software Foundation, either version 3 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. */
  25. namespace OCA\DAV\Settings;
  26. use OCP\AppFramework\Http\TemplateResponse;
  27. use OCP\IConfig;
  28. use OCP\Settings\ISettings;
  29. class CalDAVSettings implements ISettings {
  30. /** @var IConfig */
  31. private $config;
  32. /**
  33. * CalDAVSettings constructor.
  34. *
  35. * @param IConfig $config
  36. */
  37. public function __construct(IConfig $config) {
  38. $this->config = $config;
  39. }
  40. /**
  41. * @return TemplateResponse
  42. */
  43. public function getForm() {
  44. $parameters = [
  45. 'send_invitations' => $this->config->getAppValue('dav', 'sendInvitations', 'yes'),
  46. 'generate_birthday_calendar' => $this->config->getAppValue('dav', 'generateBirthdayCalendar', 'yes'),
  47. 'send_reminders_notifications' => $this->config->getAppValue('dav', 'sendEventReminders', 'yes'),
  48. 'send_reminders_notifications_push' => $this->config->getAppValue('dav', 'sendEventRemindersPush', 'no'),
  49. ];
  50. return new TemplateResponse('dav', 'settings-admin-caldav', $parameters);
  51. }
  52. /**
  53. * @return string
  54. */
  55. public function getSection() {
  56. return 'groupware';
  57. }
  58. /**
  59. * @return int
  60. */
  61. public function getPriority() {
  62. return 10;
  63. }
  64. }