1
0

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