|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * @copyright Copyright (c) 2021 Jonas Rittershofer <jotoeri@users.noreply.github.com> |
| 4 | + * |
| 5 | + * @author Jonas Rittershofer <jotoeri@users.noreply.github.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 | + |
| 24 | +namespace OCA\Forms\Activity\Settings; |
| 25 | + |
| 26 | +use OCP\Activity\ISetting; |
| 27 | +use OCP\IL10N; |
| 28 | + |
| 29 | +abstract class FormsActivitySettingsLegacy implements ISetting { |
| 30 | + protected $appName; |
| 31 | + |
| 32 | + /** @var IL10N */ |
| 33 | + protected $l10n; |
| 34 | + |
| 35 | + public function __construct(string $appName, |
| 36 | + IL10N $l10n) { |
| 37 | + $this->appName = $appName; |
| 38 | + $this->l10n = $l10n; |
| 39 | + } |
| 40 | + |
| 41 | + /** |
| 42 | + * Settings Group ID |
| 43 | + * @return string |
| 44 | + */ |
| 45 | + public function getGroupIdentifier(): string { |
| 46 | + return $this->appName; |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * Human Readable Group Title |
| 51 | + * @return string |
| 52 | + */ |
| 53 | + public function getGroupName(): string { |
| 54 | + return $this->l10n->t('Forms'); |
| 55 | + } |
| 56 | + |
| 57 | + /** |
| 58 | + * Priority of the Setting (0-100) |
| 59 | + * Using this as Forms-Basepriority |
| 60 | + * @return int |
| 61 | + */ |
| 62 | + public function getPriority(): int { |
| 63 | + return 60; |
| 64 | + } |
| 65 | + |
| 66 | + /** |
| 67 | + * User can change Mail |
| 68 | + * @return bool |
| 69 | + */ |
| 70 | + public function canChangeMail(): bool { |
| 71 | + return true; |
| 72 | + } |
| 73 | + |
| 74 | + /** |
| 75 | + * Mail disabled by default |
| 76 | + * @return bool |
| 77 | + */ |
| 78 | + public function isDefaultEnabledMail(): bool { |
| 79 | + return false; |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * User can change Stream |
| 84 | + * TODO REMOVE when NC19 out of support. |
| 85 | + * @return bool |
| 86 | + */ |
| 87 | + public function canChangeStream(): bool { |
| 88 | + return true; |
| 89 | + } |
| 90 | + |
| 91 | + /** |
| 92 | + * Stream enabled by default |
| 93 | + * TODO REMOVE when NC19 out of support. |
| 94 | + * @return bool |
| 95 | + */ |
| 96 | + public function isDefaultEnabledStream(): bool { |
| 97 | + return true; |
| 98 | + } |
| 99 | +} |
0 commit comments