PersonalSection.php 1.4 KB

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