Overview.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Settings\Settings\Admin;
  7. use OCP\AppFramework\Http\TemplateResponse;
  8. use OCP\IConfig;
  9. use OCP\IL10N;
  10. use OCP\ServerVersion;
  11. use OCP\Settings\IDelegatedSettings;
  12. class Overview implements IDelegatedSettings {
  13. public function __construct(
  14. private ServerVersion $serverVersion,
  15. private IConfig $config,
  16. private IL10N $l,
  17. ) {
  18. }
  19. /**
  20. * @return TemplateResponse
  21. */
  22. public function getForm() {
  23. $parameters = [
  24. 'checkForWorkingWellKnownSetup' => $this->config->getSystemValue('check_for_working_wellknown_setup', true),
  25. 'version' => $this->serverVersion->getHumanVersion(),
  26. ];
  27. return new TemplateResponse('settings', 'settings/admin/overview', $parameters, '');
  28. }
  29. /**
  30. * @return string the section ID, e.g. 'sharing'
  31. */
  32. public function getSection() {
  33. return 'overview';
  34. }
  35. /**
  36. * @return int whether the form should be rather on the top or bottom of
  37. * the admin section. The forms are arranged in ascending order of the
  38. * priority values. It is required to return a value between 0 and 100.
  39. *
  40. * E.g.: 70
  41. */
  42. public function getPriority() {
  43. return 10;
  44. }
  45. public function getName(): ?string {
  46. return $this->l->t('Security & setup warnings');
  47. }
  48. public function getAuthorizedAppConfig(): array {
  49. return [];
  50. }
  51. }