| @@ 9-78 (lines=70) @@ | ||
| 6 | use OCP\Activity\ISetting; |
|
| 7 | use OCP\IL10N; |
|
| 8 | ||
| 9 | class SettingAsMember implements ISetting { |
|
| 10 | ||
| 11 | /** @var IL10N */ |
|
| 12 | protected $l10n; |
|
| 13 | ||
| 14 | ||
| 15 | /** |
|
| 16 | * @param IL10N $l10n |
|
| 17 | */ |
|
| 18 | public function __construct(IL10N $l10n) { |
|
| 19 | $this->l10n = $l10n; |
|
| 20 | } |
|
| 21 | ||
| 22 | ||
| 23 | /** |
|
| 24 | * @return string Lowercase a-z and underscore only identifier |
|
| 25 | * @since 11.0.0 |
|
| 26 | */ |
|
| 27 | public function getIdentifier() { |
|
| 28 | return 'circles_as_member'; |
|
| 29 | } |
|
| 30 | ||
| 31 | ||
| 32 | /** |
|
| 33 | * @return string A translated string |
|
| 34 | * @since 11.0.0 |
|
| 35 | */ |
|
| 36 | public function getName() { |
|
| 37 | return $this->l10n->t('On events happening in a <strong>Circle</strong> of which you are a member'); |
|
| 38 | } |
|
| 39 | ||
| 40 | ||
| 41 | /** |
|
| 42 | * @return int whether the filter should be rather on the top or bottom of |
|
| 43 | * the admin section. The filters are arranged in ascending order of the |
|
| 44 | * priority values. It is required to return a value between 0 and 100. |
|
| 45 | * @since 11.0.0 |
|
| 46 | */ |
|
| 47 | public function getPriority() { |
|
| 48 | return 60; |
|
| 49 | } |
|
| 50 | ||
| 51 | ||
| 52 | /** |
|
| 53 | * @return bool True when the option can be changed for the stream |
|
| 54 | * @since 11.0.0 |
|
| 55 | */ |
|
| 56 | public function canChangeStream() { |
|
| 57 | return true; |
|
| 58 | } |
|
| 59 | ||
| 60 | ||
| 61 | /** |
|
| 62 | * @return bool True when the option can be changed for the stream |
|
| 63 | * @since 11.0.0 |
|
| 64 | */ |
|
| 65 | public function isDefaultEnabledStream() { |
|
| 66 | return true; |
|
| 67 | } |
|
| 68 | ||
| 69 | ||
| 70 | /** |
|
| 71 | * @return bool True when the option can be changed for the mail |
|
| 72 | * @since 11.0.0 |
|
| 73 | */ |
|
| 74 | public function canChangeMail() { |
|
| 75 | return true; |
|
| 76 | } |
|
| 77 | ||
| 78 | ||
| 79 | /** |
|
| 80 | * @return bool True when the option can be changed for the stream |
|
| 81 | * @since 11.0.0 |
|
| @@ 9-78 (lines=70) @@ | ||
| 6 | use OCP\Activity\ISetting; |
|
| 7 | use OCP\IL10N; |
|
| 8 | ||
| 9 | class SettingAsModerator implements ISetting { |
|
| 10 | ||
| 11 | /** @var IL10N */ |
|
| 12 | protected $l10n; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @param IL10N $l10n |
|
| 16 | */ |
|
| 17 | public function __construct(IL10N $l10n) { |
|
| 18 | $this->l10n = $l10n; |
|
| 19 | } |
|
| 20 | ||
| 21 | /** |
|
| 22 | * @return string Lowercase a-z and underscore only identifier |
|
| 23 | * @since 11.0.0 |
|
| 24 | */ |
|
| 25 | public function getIdentifier() { |
|
| 26 | return 'circles_as_moderator'; |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @return string A translated string |
|
| 31 | * @since 11.0.0 |
|
| 32 | */ |
|
| 33 | public function getName() { |
|
| 34 | return $this->l10n->t('Any important event in a <strong>Circle</strong> you are moderating'); |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * @return int whether the filter should be rather on the top or bottom of |
|
| 39 | * the admin section. The filters are arranged in ascending order of the |
|
| 40 | * priority values. It is required to return a value between 0 and 100. |
|
| 41 | * @since 11.0.0 |
|
| 42 | */ |
|
| 43 | public function getPriority() { |
|
| 44 | return 60; |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * @return bool True when the option can be changed for the stream |
|
| 49 | * @since 11.0.0 |
|
| 50 | */ |
|
| 51 | public function canChangeStream() { |
|
| 52 | return true; |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @return bool True when the option can be changed for the stream |
|
| 57 | * @since 11.0.0 |
|
| 58 | */ |
|
| 59 | public function isDefaultEnabledStream() { |
|
| 60 | return true; |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * @return bool True when the option can be changed for the mail |
|
| 65 | * @since 11.0.0 |
|
| 66 | */ |
|
| 67 | public function canChangeMail() { |
|
| 68 | return true; |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * @return bool True when the option can be changed for the stream |
|
| 73 | * @since 11.0.0 |
|
| 74 | */ |
|
| 75 | public function isDefaultEnabledMail() { |
|
| 76 | return true; |
|
| 77 | } |
|
| 78 | } |
|
| 79 | ||
| 80 | ||
| @@ 15-93 (lines=79) @@ | ||
| 12 | * |
|
| 13 | * @package OCA\Circles\Activity |
|
| 14 | */ |
|
| 15 | class SettingAsNonMember implements ISetting { |
|
| 16 | ||
| 17 | ||
| 18 | /** @var IL10N */ |
|
| 19 | protected $l10n; |
|
| 20 | ||
| 21 | ||
| 22 | /** |
|
| 23 | * @param IL10N $l10n |
|
| 24 | */ |
|
| 25 | public function __construct(IL10N $l10n) { |
|
| 26 | $this->l10n = $l10n; |
|
| 27 | } |
|
| 28 | ||
| 29 | ||
| 30 | /** |
|
| 31 | * @return string Lowercase a-z and underscore only identifier |
|
| 32 | * @since 11.0.0 |
|
| 33 | */ |
|
| 34 | public function getIdentifier() { |
|
| 35 | return 'circles_as_non_member'; |
|
| 36 | } |
|
| 37 | ||
| 38 | ||
| 39 | /** |
|
| 40 | * @return string A translated string |
|
| 41 | * @since 11.0.0 |
|
| 42 | */ |
|
| 43 | public function getName() { |
|
| 44 | return $this->l10n->t('On global events happening in any <strong>Circle</strong>'); |
|
| 45 | } |
|
| 46 | ||
| 47 | ||
| 48 | /** |
|
| 49 | * @return int whether the filter should be rather on the top or bottom of |
|
| 50 | * the admin section. The filters are arranged in ascending order of the |
|
| 51 | * priority values. It is required to return a value between 0 and 100. |
|
| 52 | * @since 11.0.0 |
|
| 53 | */ |
|
| 54 | public function getPriority() { |
|
| 55 | return 60; |
|
| 56 | } |
|
| 57 | ||
| 58 | ||
| 59 | /** |
|
| 60 | * @return bool True when the option can be changed for the stream |
|
| 61 | * @since 11.0.0 |
|
| 62 | */ |
|
| 63 | public function canChangeStream() { |
|
| 64 | return true; |
|
| 65 | } |
|
| 66 | ||
| 67 | ||
| 68 | /** |
|
| 69 | * @return bool True when the option can be changed for the stream |
|
| 70 | * @since 11.0.0 |
|
| 71 | */ |
|
| 72 | public function isDefaultEnabledStream() { |
|
| 73 | return false; |
|
| 74 | } |
|
| 75 | ||
| 76 | ||
| 77 | /** |
|
| 78 | * @return bool True when the option can be changed for the mail |
|
| 79 | * @since 11.0.0 |
|
| 80 | */ |
|
| 81 | public function canChangeMail() { |
|
| 82 | return true; |
|
| 83 | } |
|
| 84 | ||
| 85 | ||
| 86 | /** |
|
| 87 | * @return bool True when the option can be changed for the stream |
|
| 88 | * @since 11.0.0 |
|
| 89 | */ |
|
| 90 | public function isDefaultEnabledMail() { |
|
| 91 | return false; |
|
| 92 | } |
|
| 93 | } |
|
| 94 | ||
| 95 | ||