1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Nextcloud - namespace OCA\Nextnote |
4
|
|
|
* |
5
|
|
|
* @copyright Copyright (c) 2016, Sander Brand ([email protected]) |
6
|
|
|
* @copyright Copyright (c) 2016, Marcos Zuriaga Miguel ([email protected]) |
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
|
|
|
|
25
|
|
|
namespace OCA\NextNote\Settings; |
26
|
|
|
|
27
|
|
|
|
28
|
|
|
use OCP\IL10N; |
29
|
|
|
use OCP\IURLGenerator; |
30
|
|
|
use OCP\Settings\IIconSection; |
31
|
|
|
|
32
|
|
|
class AdminSection implements IIconSection { |
33
|
|
|
|
34
|
|
|
/** @var IL10N */ |
35
|
|
|
private $l; |
36
|
|
|
/** @var IURLGenerator */ |
37
|
|
|
private $url; |
38
|
|
|
|
39
|
|
|
public function __construct(IL10N $l, IURLGenerator $url) { |
40
|
|
|
$this->l = $l; |
41
|
|
|
$this->url = $url; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* returns the ID of the section. It is supposed to be a lower case string |
46
|
|
|
* |
47
|
|
|
* @returns string |
48
|
|
|
*/ |
49
|
|
|
public function getID() { |
50
|
|
|
return 'nextnote'; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* returns the translated name as it should be displayed, e.g. 'LDAP / AD |
55
|
|
|
* integration'. Use the L10N service to translate it. |
56
|
|
|
* |
57
|
|
|
* @return string |
58
|
|
|
*/ |
59
|
|
|
public function getName() { |
60
|
|
|
return $this->l->t('Nextnote'); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return int whether the form should be rather on the top or bottom of |
65
|
|
|
* the settings navigation. The sections are arranged in ascending order of |
66
|
|
|
* the priority values. It is required to return a value between 0 and 99. |
67
|
|
|
* |
68
|
|
|
* keep the server setting at the top, right after "server settings" |
69
|
|
|
*/ |
70
|
|
|
public function getPriority() { |
71
|
|
|
return 0; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* {@inheritdoc} |
76
|
|
|
*/ |
77
|
|
|
public function getIcon() { |
78
|
|
|
return $this->url->imagePath('nextnote', 'app-icon.svg'); |
79
|
|
|
} |
80
|
|
|
} |
81
|
|
|
|