Section.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Settings;
  7. use OCP\Settings\IIconSection;
  8. class Section implements IIconSection {
  9. /** @var string */
  10. private $id;
  11. /** @var string */
  12. private $name;
  13. /** @var int */
  14. private $priority;
  15. /** @var string */
  16. private $icon;
  17. /**
  18. * @param string $id
  19. * @param string $name
  20. * @param int $priority
  21. * @param string $icon
  22. */
  23. public function __construct($id, $name, $priority, $icon = '') {
  24. $this->id = $id;
  25. $this->name = $name;
  26. $this->priority = $priority;
  27. $this->icon = $icon;
  28. }
  29. /**
  30. * @return string The ID of the section. It is supposed to be a lower case string,
  31. * e.g. 'ldap'
  32. */
  33. public function getID() {
  34. return $this->id;
  35. }
  36. /**
  37. * @return string The translated name as it should be displayed, e.g. 'LDAP / AD
  38. * integration'. Use the L10N service to translate it.
  39. */
  40. public function getName() {
  41. return $this->name;
  42. }
  43. /**
  44. * @return int whether the form should be rather on the top or bottom of
  45. * the settings navigation. The sections are arranged in ascending order of
  46. * the priority values. It is required to return a value between 0 and 99.
  47. *
  48. * E.g.: 70
  49. */
  50. public function getPriority() {
  51. return $this->priority;
  52. }
  53. /**
  54. * @return string The relative path to an 16*16 icon describing the section.
  55. * e.g. '/core/img/places/files.svg'
  56. *
  57. * @since 12
  58. */
  59. public function getIcon() {
  60. return $this->icon;
  61. }
  62. }