-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Expand file tree
/
Copy pathExampleContentSettings.php
More file actions
47 lines (39 loc) · 1.66 KB
/
Copy pathExampleContentSettings.php
File metadata and controls
47 lines (39 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Settings;
use OCA\DAV\AppInfo\Application;
use OCA\DAV\Service\ExampleContactService;
use OCA\DAV\Service\ExampleEventService;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IAppConfig;
use OCP\AppFramework\Services\IInitialState;
use OCP\Settings\ISettings;
use OCP\Util;
class ExampleContentSettings implements ISettings {
public function __construct(
private readonly IAppConfig $appConfig,
private readonly IInitialState $initialState,
private readonly ExampleEventService $exampleEventService,
private readonly ExampleContactService $exampleContactService,
) {
}
public function getForm(): TemplateResponse {
$this->initialState->provideInitialState('create_example_event', $this->exampleEventService->shouldCreateExampleEvent());
$this->initialState->provideInitialState('has_custom_example_event', $this->exampleEventService->hasCustomExampleEvent());
$this->initialState->provideInitialState('enableDefaultContact', $this->exampleContactService->isDefaultContactEnabled());
$this->initialState->provideInitialState('hasCustomDefaultContact', $this->appConfig->getAppValueBool('hasCustomDefaultContact'));
Util::addStyle(Application::APP_ID, 'settings-admin-example-content');
Util::addScript(Application::APP_ID, 'settings-admin-example-content');
return new TemplateResponse(Application::APP_ID, 'settings-admin-example-content');
}
public function getSection(): ?string {
return 'groupware';
}
public function getPriority(): int {
return 10;
}
}