1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @copyright Copyright (c) 2016 Arthur Schiwon <[email protected]> |
4
|
|
|
* |
5
|
|
|
* @author Arthur Schiwon <[email protected]> |
6
|
|
|
* @author Joas Schilling <[email protected]> |
7
|
|
|
* |
8
|
|
|
* @license GNU AGPL version 3 or any later version |
9
|
|
|
* |
10
|
|
|
* This program is free software: you can redistribute it and/or modify |
11
|
|
|
* it under the terms of the GNU Affero General Public License as |
12
|
|
|
* published by the Free Software Foundation, either version 3 of the |
13
|
|
|
* License, or (at your option) any later version. |
14
|
|
|
* |
15
|
|
|
* This program is distributed in the hope that it will be useful, |
16
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
17
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18
|
|
|
* GNU Affero General Public License for more details. |
19
|
|
|
* |
20
|
|
|
* You should have received a copy of the GNU Affero General Public License |
21
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
22
|
|
|
* |
23
|
|
|
*/ |
24
|
|
|
|
25
|
|
|
namespace OCA\Theming\Settings; |
26
|
|
|
|
27
|
|
|
use OCP\IL10N; |
28
|
|
|
use OCP\IURLGenerator; |
29
|
|
|
use OCP\Settings\IIconSection; |
30
|
|
|
|
31
|
|
|
class Section implements IIconSection { |
32
|
|
|
/** @var IL10N */ |
33
|
|
|
private $l; |
34
|
|
|
/** @var IURLGenerator */ |
35
|
|
|
private $url; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @param IURLGenerator $url |
39
|
|
|
* @param IL10N $l |
40
|
|
|
*/ |
41
|
|
|
public function __construct(IURLGenerator $url, IL10N $l) { |
42
|
|
|
$this->url = $url; |
43
|
|
|
$this->l = $l; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* returns the ID of the section. It is supposed to be a lower case string, |
48
|
|
|
* e.g. 'ldap' |
49
|
|
|
* |
50
|
|
|
* @returns string |
51
|
|
|
*/ |
52
|
|
|
public function getID() { |
53
|
|
|
return 'theming'; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* returns the translated name as it should be displayed, e.g. 'LDAP / AD |
58
|
|
|
* integration'. Use the L10N service to translate it. |
59
|
|
|
* |
60
|
|
|
* @return string |
61
|
|
|
*/ |
62
|
|
|
public function getName() { |
63
|
|
|
return $this->l->t('Theming'); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return int whether the form should be rather on the top or bottom of |
68
|
|
|
* the settings navigation. The sections are arranged in ascending order of |
69
|
|
|
* the priority values. It is required to return a value between 0 and 99. |
70
|
|
|
* |
71
|
|
|
* E.g.: 70 |
72
|
|
|
*/ |
73
|
|
|
public function getPriority() { |
74
|
|
|
return 30; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* {@inheritdoc} |
79
|
|
|
*/ |
80
|
|
|
public function getIcon() { |
81
|
|
|
return $this->url->imagePath('theming', 'app-dark.svg'); |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|