1
0

Section.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Valdnet <47037905+Valdnet@users.noreply.github.com>
  9. *
  10. * @license GNU AGPL version 3 or any later version
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License as
  14. * published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. namespace OCA\User_LDAP\Settings;
  27. use OCP\IL10N;
  28. use OCP\IURLGenerator;
  29. use OCP\Settings\IIconSection;
  30. class Section implements IIconSection {
  31. /** @var IL10N */
  32. private $l;
  33. /** @var IURLGenerator */
  34. private $url;
  35. /**
  36. * @param IURLGenerator $url
  37. * @param IL10N $l
  38. */
  39. public function __construct(IURLGenerator $url, IL10N $l) {
  40. $this->url = $url;
  41. $this->l = $l;
  42. }
  43. /**
  44. * returns the ID of the section. It is supposed to be a lower case string,
  45. * e.g. 'ldap'
  46. *
  47. * @returns string
  48. */
  49. public function getID() {
  50. return 'ldap';
  51. }
  52. /**
  53. * returns the translated name as it should be displayed, e.g. 'LDAP/AD
  54. * integration'. Use the L10N service to translate it.
  55. *
  56. * @return string
  57. */
  58. public function getName() {
  59. return $this->l->t('LDAP/AD integration');
  60. }
  61. /**
  62. * @return int whether the form should be rather on the top or bottom of
  63. * the settings navigation. The sections are arranged in ascending order of
  64. * the priority values. It is required to return a value between 0 and 99.
  65. *
  66. * E.g.: 70
  67. */
  68. public function getPriority() {
  69. return 25;
  70. }
  71. /**
  72. * {@inheritdoc}
  73. */
  74. public function getIcon() {
  75. return $this->url->imagePath('user_ldap', 'app-dark.svg');
  76. }
  77. }