diff options
author | Joas Schilling <coding@schilljs.com> | 2022-05-24 15:49:34 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-07-01 12:33:07 +0200 |
commit | 4f7f4d74db0464b255eeedd4890b0604540e1e60 (patch) | |
tree | c1ea3cc60c8353c0aaed100733adf5b01611956b /apps/dav/lib | |
parent | 5dee54d70bcd207c9b96a4cf6bb58f82fe9fbba9 (diff) | |
download | nextcloud-server-4f7f4d74db0464b255eeedd4890b0604540e1e60.tar.gz nextcloud-server-4f7f4d74db0464b255eeedd4890b0604540e1e60.zip |
Add UI to opt-in on the status automation
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/Settings/AvailabilitySettings.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/dav/lib/Settings/AvailabilitySettings.php b/apps/dav/lib/Settings/AvailabilitySettings.php index 9a163e21edb..2bafdfab9d7 100644 --- a/apps/dav/lib/Settings/AvailabilitySettings.php +++ b/apps/dav/lib/Settings/AvailabilitySettings.php @@ -27,10 +27,35 @@ namespace OCA\DAV\Settings; use OCA\DAV\AppInfo\Application; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Services\IInitialState; +use OCP\IConfig; +use OCP\IUserSession; use OCP\Settings\ISettings; class AvailabilitySettings implements ISettings { + protected IUserSession $userSession; + protected IConfig $config; + protected IInitialState $initialState; + + public function __construct(IUserSession $userSession, + IConfig $config, + IInitialState $initialState) { + $this->userSession = $userSession; + $this->config = $config; + $this->initialState = $initialState; + } + public function getForm(): TemplateResponse { + $this->initialState->provideInitialState( + 'user_status_automation', + $this->config->getUserValue( + $this->userSession->getUser()->getUID(), + 'dav', + 'user_status_automation', + 'no' + ) + ); + return new TemplateResponse(Application::APP_ID, 'settings-personal-availability'); } |