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\User_LDAP\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 'ldap';
  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('LDAP/AD integration');
  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 25;
  50. }
  51. /**
  52. * {@inheritdoc}
  53. */
  54. public function getIcon() {
  55. return $this->url->imagePath('user_ldap', 'app-dark.svg');
  56. }
  57. }