1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Bookmarks_FullTextSearch - Indexing bookmarks |
7
|
|
|
* |
8
|
|
|
* This file is licensed under the Affero General Public License version 3 or |
9
|
|
|
* later. See the COPYING file. |
10
|
|
|
* |
11
|
|
|
* @author Maxence Lange <[email protected]> |
12
|
|
|
* @copyright 2018 |
13
|
|
|
* @license GNU AGPL version 3 or any later version |
14
|
|
|
* |
15
|
|
|
* This program is free software: you can redistribute it and/or modify |
16
|
|
|
* it under the terms of the GNU Affero General Public License as |
17
|
|
|
* published by the Free Software Foundation, either version 3 of the |
18
|
|
|
* License, or (at your option) any later version. |
19
|
|
|
* |
20
|
|
|
* This program is distributed in the hope that it will be useful, |
21
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
22
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23
|
|
|
* GNU Affero General Public License for more details. |
24
|
|
|
* |
25
|
|
|
* You should have received a copy of the GNU Affero General Public License |
26
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
27
|
|
|
* |
28
|
|
|
*/ |
29
|
|
|
|
30
|
|
|
|
31
|
|
|
namespace OCA\Bookmarks_FullTextSearch\Settings; |
32
|
|
|
|
33
|
|
|
|
34
|
|
|
use Exception; |
35
|
|
|
use OCA\Bookmarks_FullTextSearch\AppInfo\Application; |
36
|
|
|
use OCA\Bookmarks_FullTextSearch\Service\ConfigService; |
37
|
|
|
use OCA\Bookmarks_FullTextSearch\Service\MiscService; |
38
|
|
|
use OCP\AppFramework\Http\TemplateResponse; |
39
|
|
|
use OCP\IL10N; |
40
|
|
|
use OCP\IURLGenerator; |
41
|
|
|
use OCP\Settings\ISettings; |
42
|
|
|
|
43
|
|
|
|
44
|
|
|
class Admin implements ISettings { |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
/** @var IL10N */ |
48
|
|
|
private $l10n; |
49
|
|
|
|
50
|
|
|
/** @var IURLGenerator */ |
51
|
|
|
private $urlGenerator; |
52
|
|
|
|
53
|
|
|
/** @var ConfigService */ |
54
|
|
|
private $configService; |
55
|
|
|
|
56
|
|
|
/** @var MiscService */ |
57
|
|
|
private $miscService; |
58
|
|
|
|
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param IL10N $l10n |
62
|
|
|
* @param IURLGenerator $urlGenerator |
63
|
|
|
* @param ConfigService $configService |
64
|
|
|
* @param MiscService $miscService |
65
|
|
|
*/ |
66
|
|
|
public function __construct( |
67
|
|
|
IL10N $l10n, IURLGenerator $urlGenerator, ConfigService $configService, |
68
|
|
|
MiscService $miscService |
69
|
|
|
) { |
70
|
|
|
$this->l10n = $l10n; |
71
|
|
|
$this->urlGenerator = $urlGenerator; |
72
|
|
|
$this->configService = $configService; |
73
|
|
|
$this->miscService = $miscService; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @return TemplateResponse |
79
|
|
|
* @throws Exception |
80
|
|
|
*/ |
81
|
|
|
public function getForm(): TemplateResponse { |
82
|
|
|
return new TemplateResponse(Application::APP_NAME, 'settings.admin', []); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return string the section ID, e.g. 'sharing' |
88
|
|
|
*/ |
89
|
|
|
public function getSection(): string { |
90
|
|
|
return 'fulltextsearch'; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return int whether the form should be rather on the top or bottom of |
96
|
|
|
* the admin section. The forms are arranged in ascending order of the |
97
|
|
|
* priority values. It is required to return a value between 0 and 100. |
98
|
|
|
* |
99
|
|
|
* keep the server setting at the top, right after "server settings" |
100
|
|
|
*/ |
101
|
|
|
public function getPriority(): int { |
102
|
|
|
return 52; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
|