PersonalSection.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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\Theming\Settings;
  7. use OCP\IL10N;
  8. use OCP\IURLGenerator;
  9. use OCP\Settings\IIconSection;
  10. class PersonalSection implements IIconSection {
  11. /**
  12. * Personal Section constructor.
  13. *
  14. * @param string $appName
  15. * @param IURLGenerator $urlGenerator
  16. * @param IL10N $l
  17. */
  18. public function __construct(
  19. protected string $appName,
  20. private IURLGenerator $urlGenerator,
  21. private IL10N $l,
  22. ) {
  23. }
  24. /**
  25. * returns the relative path to an 16*16 icon describing the section.
  26. * e.g. '/core/img/places/files.svg'
  27. *
  28. * @returns string
  29. * @since 13.0.0
  30. */
  31. public function getIcon() {
  32. return $this->urlGenerator->imagePath($this->appName, 'accessibility-dark.svg');
  33. }
  34. /**
  35. * returns the ID of the section. It is supposed to be a lower case string,
  36. * e.g. 'ldap'
  37. *
  38. * @returns string
  39. * @since 9.1
  40. */
  41. public function getID() {
  42. return $this->appName;
  43. }
  44. /**
  45. * returns the translated name as it should be displayed, e.g. 'LDAP / AD
  46. * integration'. Use the L10N service to translate it.
  47. *
  48. * @return string
  49. * @since 9.1
  50. */
  51. public function getName() {
  52. return $this->l->t('Appearance and accessibility');
  53. }
  54. /**
  55. * @return int whether the form should be rather on the top or bottom of
  56. * the settings navigation. The sections are arranged in ascending order of
  57. * the priority values. It is required to return a value between 0 and 99.
  58. *
  59. * E.g.: 70
  60. * @since 9.1
  61. */
  62. public function getPriority() {
  63. return 15;
  64. }
  65. }