1
0

AdminSection.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Theming\Settings;
  7. use OCP\IL10N;
  8. use OCP\IURLGenerator;
  9. use OCP\Settings\IIconSection;
  10. class AdminSection implements IIconSection {
  11. public function __construct(
  12. private string $appName,
  13. private IURLGenerator $url,
  14. private IL10N $l,
  15. ) {
  16. }
  17. /**
  18. * returns the ID of the section. It is supposed to be a lower case string,
  19. * e.g. 'ldap'
  20. *
  21. * @returns string
  22. */
  23. public function getID() {
  24. return $this->appName;
  25. }
  26. /**
  27. * returns the translated name as it should be displayed, e.g. 'LDAP / AD
  28. * integration'. Use the L10N service to translate it.
  29. *
  30. * @return string
  31. */
  32. public function getName() {
  33. return $this->l->t('Theming');
  34. }
  35. /**
  36. * @return int whether the form should be rather on the top or bottom of
  37. * the settings navigation. The sections are arranged in ascending order of
  38. * the priority values. It is required to return a value between 0 and 99.
  39. *
  40. * E.g.: 70
  41. */
  42. public function getPriority() {
  43. return 30;
  44. }
  45. /**
  46. * {@inheritdoc}
  47. */
  48. public function getIcon() {
  49. return $this->url->imagePath($this->appName, 'app-dark.svg');
  50. }
  51. }