1
0

Section.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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\Files_External\Settings;
  7. use OCP\IL10N;
  8. use OCP\IURLGenerator;
  9. use OCP\Settings\IIconSection;
  10. class Section implements IIconSection {
  11. /**
  12. * @param IURLGenerator $url
  13. * @param IL10N $l
  14. */
  15. public function __construct(
  16. private IURLGenerator $url,
  17. private IL10N $l,
  18. ) {
  19. }
  20. /**
  21. * returns the ID of the section. It is supposed to be a lower case string,
  22. * e.g. 'ldap'
  23. *
  24. * @returns string
  25. */
  26. public function getID() {
  27. return 'externalstorages';
  28. }
  29. /**
  30. * returns the translated name as it should be displayed, e.g. 'LDAP / AD
  31. * integration'. Use the L10N service to translate it.
  32. *
  33. * @return string
  34. */
  35. public function getName() {
  36. return $this->l->t('External storage');
  37. }
  38. /**
  39. * @return int whether the form should be rather on the top or bottom of
  40. * the settings navigation. The sections are arranged in ascending order of
  41. * the priority values. It is required to return a value between 0 and 99.
  42. *
  43. * E.g.: 70
  44. */
  45. public function getPriority() {
  46. return 10;
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. public function getIcon() {
  52. return $this->url->imagePath('files_external', 'app-dark.svg');
  53. }
  54. }