Section.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 Lukas Reschke <lukas@statuscode.ch>
  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 OC\Settings;
  26. use OCP\Settings\IIconSection;
  27. class Section implements IIconSection {
  28. /** @var string */
  29. private $id;
  30. /** @var string */
  31. private $name;
  32. /** @var int */
  33. private $priority;
  34. /** @var string */
  35. private $icon;
  36. /**
  37. * @param string $id
  38. * @param string $name
  39. * @param int $priority
  40. * @param string $icon
  41. */
  42. public function __construct($id, $name, $priority, $icon = '') {
  43. $this->id = $id;
  44. $this->name = $name;
  45. $this->priority = $priority;
  46. $this->icon = $icon;
  47. }
  48. /**
  49. * @return string The ID of the section. It is supposed to be a lower case string,
  50. * e.g. 'ldap'
  51. */
  52. public function getID() {
  53. return $this->id;
  54. }
  55. /**
  56. * @return string The translated name as it should be displayed, e.g. 'LDAP / AD
  57. * integration'. Use the L10N service to translate it.
  58. */
  59. public function getName() {
  60. return $this->name;
  61. }
  62. /**
  63. * @return int whether the form should be rather on the top or bottom of
  64. * the settings navigation. The sections are arranged in ascending order of
  65. * the priority values. It is required to return a value between 0 and 99.
  66. *
  67. * E.g.: 70
  68. */
  69. public function getPriority() {
  70. return $this->priority;
  71. }
  72. /**
  73. * @return string The relative path to an 16*16 icon describing the section.
  74. * e.g. '/core/img/places/files.svg'
  75. *
  76. * @since 12
  77. */
  78. public function getIcon() {
  79. return $this->icon;
  80. }
  81. }