Section.php 1.3 KB

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