Users.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Settings\Settings\Admin;
  8. use OCP\AppFramework\Http\TemplateResponse;
  9. use OCP\IL10N;
  10. use OCP\Settings\IDelegatedSettings;
  11. /**
  12. * Empty settings class, used only for admin delegation.
  13. */
  14. class Users implements IDelegatedSettings {
  15. public function __construct(
  16. protected string $appName,
  17. private IL10N $l10n,
  18. ) {
  19. }
  20. /**
  21. * Empty template response
  22. */
  23. public function getForm(): TemplateResponse {
  24. return new /** @template-extends TemplateResponse<\OCP\AppFramework\Http::STATUS_OK, array{}> */ class($this->appName, '') extends TemplateResponse {
  25. public function render(): string {
  26. return '';
  27. }
  28. };
  29. }
  30. public function getSection(): ?string {
  31. return 'admindelegation';
  32. }
  33. /**
  34. * @return int whether the form should be rather on the top or bottom of
  35. * the admin section. The forms are arranged in ascending order of the
  36. * priority values. It is required to return a value between 0 and 100.
  37. *
  38. * E.g.: 70
  39. */
  40. public function getPriority(): int {
  41. return 0;
  42. }
  43. public function getName(): string {
  44. return $this->l10n->t('Users');
  45. }
  46. public function getAuthorizedAppConfig(): array {
  47. return [];
  48. }
  49. }