Skip to content

Commit 8984b2d

Browse files
committed
add log section
1 parent 85939ec commit 8984b2d

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

appinfo/info.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
<id>logreader</id>
55
<name>Log Reader</name>
66
<description>Easier reading of logs</description>
7-
<version>1.3.0</version>
7+
<version>1.3.1</version>
88
<licence>AGPL</licence>
99
<author>Robin Appelman</author>
1010
<namespace>LogReader</namespace>
1111
<default_enable/>
1212

1313
<settings>
1414
<admin>OCA\LogReader\Settings\Admin</admin>
15+
<admin-section>OCA\LogReader\Settings\Section</admin-section>
1516
</settings>
1617

1718
<website>https://github.com/nextcloud/logreader</website>

lib/Settings/Section.php

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

0 commit comments

Comments
 (0)