diff options
Diffstat (limited to 'apps/dav/lib/Settings')
-rw-r--r-- | apps/dav/lib/Settings/CalDAVSettings.php | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/apps/dav/lib/Settings/CalDAVSettings.php b/apps/dav/lib/Settings/CalDAVSettings.php index 0e0525e29a4..fb541e1574f 100644 --- a/apps/dav/lib/Settings/CalDAVSettings.php +++ b/apps/dav/lib/Settings/CalDAVSettings.php @@ -29,9 +29,9 @@ use OCA\DAV\AppInfo\Application; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\AppFramework\Services\IInitialState; -use OCP\Settings\ISettings; +use OCP\Settings\IDelegatedSettings; -class CalDAVSettings implements ISettings { +class CalDAVSettings implements IDelegatedSettings { /** @var IConfig */ private $config; @@ -39,6 +39,13 @@ class CalDAVSettings implements ISettings { /** @var IInitialState */ private $initialState; + private const defaults = [ + 'sendInvitations' => 'yes', + 'generateBirthdayCalendar' => 'yes', + 'sendEventReminders' => 'yes', + 'sendEventRemindersPush' => 'no', + ]; + /** * CalDAVSettings constructor. * @@ -51,13 +58,7 @@ class CalDAVSettings implements ISettings { } public function getForm(): TemplateResponse { - $defaults = [ - 'sendInvitations' => 'yes', - 'generateBirthdayCalendar' => 'yes', - 'sendEventReminders' => 'yes', - 'sendEventRemindersPush' => 'no', - ]; - foreach ($defaults as $key => $default) { + foreach (self::defaults as $key => $default) { $value = $this->config->getAppValue(Application::APP_ID, $key, $default); $this->initialState->provideInitialState($key, $value === 'yes'); } @@ -77,4 +78,14 @@ class CalDAVSettings implements ISettings { public function getPriority() { return 10; } + + public function getName(): ?string { + return null; // Only setting in this section + } + + public function getAuthorizedAppConfig(): array { + return [ + 'dav' => ['/(' . implode('|', array_keys(self::defaults)) . ')/'] + ]; + } } |