PersonalSection.php 1.5 KB

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