| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,86 @@ |
| 1 |
+<?php |
|
| 2 |
+/** |
|
| 3 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 4 |
+ * |
|
| 5 |
+ * @author Double Bastion LLC |
|
| 6 |
+ * |
|
| 7 |
+ * @license GNU AGPL version 3 or any later version |
|
| 8 |
+ * |
|
| 9 |
+ * This program is free software; you can redistribute it and/or |
|
| 10 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 11 |
+ * License as published by the Free Software Foundation; either |
|
| 12 |
+ * version 3 of the License, or 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 |
|
| 20 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 |
+ * |
|
| 22 |
+ */ |
|
| 23 |
+ |
|
| 24 |
+declare(strict_types=1); |
|
| 25 |
+ |
|
| 26 |
+namespace OCA\SMSRelentless\Settings; |
|
| 27 |
+ |
|
| 28 |
+use OCP\IL10N; |
|
| 29 |
+use OCP\IURLGenerator; |
|
| 30 |
+use OCP\Settings\IIconSection; |
|
| 31 |
+ |
|
| 32 |
+ |
|
| 33 |
+class AdminSection implements IIconSection {
|
|
| 34 |
+ /** @var IL10N */ |
|
| 35 |
+ private $l; |
|
| 36 |
+ /** @var IURLGenerator */ |
|
| 37 |
+ private $url; |
|
| 38 |
+ |
|
| 39 |
+ /** |
|
| 40 |
+ * @param IURLGenerator $url |
|
| 41 |
+ * @param IL10N $l |
|
| 42 |
+ */ |
|
| 43 |
+ public function __construct(IURLGenerator $url, IL10N $l) {
|
|
| 44 |
+ $this->url = $url; |
|
| 45 |
+ $this->l = $l; |
|
| 46 |
+ } |
|
| 47 |
+ |
|
| 48 |
+ /** |
|
| 49 |
+ * returns the ID of the section. It is supposed to be a lower case string, |
|
| 50 |
+ * e.g. 'ldap' |
|
| 51 |
+ * |
|
| 52 |
+ * @returns string |
|
| 53 |
+ */ |
|
| 54 |
+ public function getID() {
|
|
| 55 |
+ return 'sms_relentless'; |
|
| 56 |
+ } |
|
| 57 |
+ |
|
| 58 |
+ /** |
|
| 59 |
+ * returns the translated name as it should be displayed, e.g. 'LDAP / AD |
|
| 60 |
+ * integration'. Use the L10N service to translate it. |
|
| 61 |
+ * |
|
| 62 |
+ * @return string |
|
| 63 |
+ */ |
|
| 64 |
+ public function getName() {
|
|
| 65 |
+ return $this->l->t('SMS Relentless');
|
|
| 66 |
+ } |
|
| 67 |
+ |
|
| 68 |
+ /** |
|
| 69 |
+ * @return int whether the form should be rather on the top or bottom of |
|
| 70 |
+ * the settings navigation. The sections are arranged in ascending order of |
|
| 71 |
+ * the priority values. It is required to return a value between 0 and 99. |
|
| 72 |
+ * |
|
| 73 |
+ * E.g.: 70 |
|
| 74 |
+ */ |
|
| 75 |
+ public function getPriority() {
|
|
| 76 |
+ return 11; |
|
| 77 |
+ } |
|
| 78 |
+ |
|
| 79 |
+ /** |
|
| 80 |
+ * {@inheritdoc}
|
|
| 81 |
+ */ |
|
| 82 |
+ public function getIcon() {
|
|
| 83 |
+ return $this->url->imagePath('sms_relentless', 'sms_relentless_dark.svg');
|
|
| 84 |
+ } |
|
| 85 |
+} |
|
| 86 |
+ |