File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,5 +65,6 @@ For an demo of this app visit [https://demo.passman.cc](https://demo.passman.cc)
6565
6666 <settings >
6767 <admin >OCA\Passman\Settings\Admin</admin >
68+ <admin-section >OCA\Passman\Settings\AdminSection</admin-section >
6869 </settings >
6970</info >
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public function getForm() {
4646 * @return string the section ID, e.g. 'sharing'
4747 */
4848 public function getSection () {
49- return 'additional ' ;
49+ return 'passman ' ;
5050 }
5151
5252 /**
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public function getForm(): TemplateResponse {
9595 * @return string
9696 */
9797 public function getSection (): string {
98- return 'additional ' ;
98+ return 'passman ' ;
9999 }
100100
101101 /**
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
5+ * SPDX-License-Identifier: AGPL-3.0-or-later
6+ */
7+ namespace OCA \Passman \Settings ;
8+
9+ use OCP \IL10N ;
10+ use OCP \IURLGenerator ;
11+ use OCP \Settings \IIconSection ;
12+
13+ class AdminSection implements IIconSection {
14+ public function __construct (
15+ private string $ appName ,
16+ private IURLGenerator $ url ,
17+ private IL10N $ l ,
18+ ) {
19+ }
20+
21+ /**
22+ * returns the ID of the section. It is supposed to be a lower case string,
23+ * e.g. 'ldap'
24+ *
25+ * @returns string
26+ */
27+ public function getID () {
28+ return $ this ->appName ;
29+ }
30+
31+ /**
32+ * returns the translated name as it should be displayed, e.g. 'LDAP / AD
33+ * integration'. Use the L10N service to translate it.
34+ *
35+ * @return string
36+ */
37+ public function getName () {
38+ return $ this ->l ->t ('Passman ' );
39+ }
40+
41+ /**
42+ * @return int whether the form should be rather on the top or bottom of
43+ * the settings navigation. The sections are arranged in ascending order of
44+ * the priority values. It is required to return a value between 0 and 99.
45+ *
46+ * E.g.: 70
47+ */
48+ public function getPriority () {
49+ return 70 ;
50+ }
51+
52+ /**
53+ * {@inheritdoc}
54+ */
55+ public function getIcon () {
56+ return $ this ->url ->imagePath ($ this ->appName , 'app-dark.svg ' );
57+ }
58+ }
You can’t perform that action at this time.
0 commit comments