LegacySetting.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. namespace OC\Activity;
  22. use OCP\Activity\ISetting;
  23. class LegacySetting implements ISetting {
  24. /** @var string */
  25. protected $identifier;
  26. /** @var string */
  27. protected $name;
  28. /** @var bool */
  29. protected $canChangeStream;
  30. /** @var bool */
  31. protected $isDefaultEnabledStream;
  32. /** @var bool */
  33. protected $canChangeMail;
  34. /** @var bool */
  35. protected $isDefaultEnabledMail;
  36. /**
  37. * LegacySetting constructor.
  38. *
  39. * @param string $identifier
  40. * @param string $name
  41. * @param bool $canChangeStream
  42. * @param bool $isDefaultEnabledStream
  43. * @param bool $canChangeMail
  44. * @param bool $isDefaultEnabledMail
  45. */
  46. public function __construct($identifier,
  47. $name,
  48. $canChangeStream,
  49. $isDefaultEnabledStream,
  50. $canChangeMail,
  51. $isDefaultEnabledMail) {
  52. $this->identifier = $identifier;
  53. $this->name = $name;
  54. $this->canChangeStream = $canChangeStream;
  55. $this->isDefaultEnabledStream = $isDefaultEnabledStream;
  56. $this->canChangeMail = $canChangeMail;
  57. $this->isDefaultEnabledMail = $isDefaultEnabledMail;
  58. }
  59. /**
  60. * @return string Lowercase a-z and underscore only identifier
  61. * @since 11.0.0
  62. */
  63. public function getIdentifier() {
  64. return $this->identifier;
  65. }
  66. /**
  67. * @return string A translated string
  68. * @since 11.0.0
  69. */
  70. public function getName() {
  71. return $this->name;
  72. }
  73. /**
  74. * @return int whether the filter should be rather on the top or bottom of
  75. * the admin section. The filters are arranged in ascending order of the
  76. * priority values. It is required to return a value between 0 and 100.
  77. * @since 11.0.0
  78. */
  79. public function getPriority() {
  80. return 70;
  81. }
  82. /**
  83. * @return bool True when the option can be changed for the stream
  84. * @since 11.0.0
  85. */
  86. public function canChangeStream() {
  87. return $this->canChangeStream;
  88. }
  89. /**
  90. * @return bool True when the option can be changed for the stream
  91. * @since 11.0.0
  92. */
  93. public function isDefaultEnabledStream() {
  94. return $this->isDefaultEnabledStream;
  95. }
  96. /**
  97. * @return bool True when the option can be changed for the mail
  98. * @since 11.0.0
  99. */
  100. public function canChangeMail() {
  101. return $this->canChangeMail;
  102. }
  103. /**
  104. * @return bool True when the option can be changed for the stream
  105. * @since 11.0.0
  106. */
  107. public function isDefaultEnabledMail() {
  108. return $this->isDefaultEnabledMail;
  109. }
  110. }