ActivitySettingsAdapter.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Activity;
  8. use OCP\Activity\ActivitySettings;
  9. use OCP\Activity\ISetting;
  10. use OCP\IL10N;
  11. /**
  12. * Adapt the old interface based settings into the new abstract
  13. * class based one
  14. */
  15. class ActivitySettingsAdapter extends ActivitySettings {
  16. private $oldSettings;
  17. private $l10n;
  18. public function __construct(ISetting $oldSettings, IL10N $l10n) {
  19. $this->oldSettings = $oldSettings;
  20. $this->l10n = $l10n;
  21. }
  22. public function getIdentifier() {
  23. return $this->oldSettings->getIdentifier();
  24. }
  25. public function getName() {
  26. return $this->oldSettings->getName();
  27. }
  28. public function getGroupIdentifier() {
  29. return 'other';
  30. }
  31. public function getGroupName() {
  32. return $this->l10n->t('Other activities');
  33. }
  34. public function getPriority() {
  35. return $this->oldSettings->getPriority();
  36. }
  37. public function canChangeMail() {
  38. return $this->oldSettings->canChangeMail();
  39. }
  40. public function isDefaultEnabledMail() {
  41. return $this->oldSettings->isDefaultEnabledMail();
  42. }
  43. }