1
0

LegacySetting.php 3.1 KB

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