|
9 | 9 |
|
10 | 10 | namespace OCA\WebhookListeners\Settings; |
11 | 11 |
|
12 | | -use OCP\AppFramework\Http; |
| 12 | +use OCA\WebhookListeners\AppInfo\Application; |
13 | 13 | use OCP\AppFramework\Http\TemplateResponse; |
14 | | -use OCP\IL10N; |
15 | 14 | use OCP\Settings\IDelegatedSettings; |
16 | 15 |
|
17 | 16 | /** |
18 | 17 | * Empty settings class, used only for admin delegation for now as there is no UI |
19 | 18 | */ |
20 | 19 | class Admin implements IDelegatedSettings { |
21 | | - |
22 | | - public function __construct( |
23 | | - protected string $appName, |
24 | | - private IL10N $l10n, |
25 | | - ) { |
26 | | - } |
27 | | - |
28 | 20 | /** |
29 | 21 | * Empty template response |
30 | 22 | */ |
31 | 23 | public function getForm(): TemplateResponse { |
32 | | - |
33 | | - return new /** @template-extends TemplateResponse<Http::STATUS_OK, array{}> */ class($this->appName, '') extends TemplateResponse { |
34 | | - public function render(): string { |
35 | | - return ''; |
36 | | - } |
37 | | - }; |
| 24 | + throw new \Exception('Admin delegation settings should never be rendered'); |
38 | 25 | } |
39 | 26 |
|
40 | | - public function getSection(): ?string { |
41 | | - return 'admindelegation'; |
| 27 | + public function getSection(): string { |
| 28 | + return Application::APP_ID . '-admin'; |
42 | 29 | } |
43 | 30 |
|
44 | | - /** |
45 | | - * @return int whether the form should be rather on the top or bottom of |
46 | | - * the admin section. The forms are arranged in ascending order of the |
47 | | - * priority values. It is required to return a value between 0 and 100. |
48 | | - * |
49 | | - * E.g.: 70 |
50 | | - */ |
51 | 31 | public function getPriority(): int { |
52 | 32 | return 0; |
53 | 33 | } |
54 | 34 |
|
55 | | - public function getName(): string { |
56 | | - return $this->l10n->t('Webhooks'); |
| 35 | + public function getName(): ?string { |
| 36 | + /* Use section name alone */ |
| 37 | + return null; |
57 | 38 | } |
58 | 39 |
|
59 | 40 | public function getAuthorizedAppConfig(): array { |
|
0 commit comments