Skip to content

Commit 8b13f6d

Browse files
committed
Add Calendar settings section
In replacement of the removed Groupware settings section in #34626 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
1 parent 4415fca commit 8b13f6d

4 files changed

Lines changed: 58 additions & 0 deletions

File tree

apps/settings/appinfo/info.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<personal>OCA\Settings\Settings\Personal\Security\TwoFactor</personal>
3939
<personal>OCA\Settings\Settings\Personal\Security\WebAuthn</personal>
4040
<personal-section>OCA\Settings\Sections\Personal\Availability</personal-section>
41+
<personal-section>OCA\Settings\Sections\Personal\Calendar</personal-section>
4142
<personal-section>OCA\Settings\Sections\Personal\PersonalInfo</personal-section>
4243
<personal-section>OCA\Settings\Sections\Personal\Security</personal-section>
4344
<personal-section>OCA\Settings\Sections\Personal\SyncClients</personal-section>

apps/settings/composer/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
'OCA\\Settings\\Sections\\Admin\\Server' => $baseDir . '/../lib/Sections/Admin/Server.php',
5050
'OCA\\Settings\\Sections\\Admin\\Sharing' => $baseDir . '/../lib/Sections/Admin/Sharing.php',
5151
'OCA\\Settings\\Sections\\Personal\\Availability' => $baseDir . '/../lib/Sections/Personal/Availability.php',
52+
'OCA\\Settings\\Sections\\Personal\\Calendar' => $baseDir . '/../lib/Sections/Personal/Calendar.php',
5253
'OCA\\Settings\\Sections\\Personal\\PersonalInfo' => $baseDir . '/../lib/Sections/Personal/PersonalInfo.php',
5354
'OCA\\Settings\\Sections\\Personal\\Security' => $baseDir . '/../lib/Sections/Personal/Security.php',
5455
'OCA\\Settings\\Sections\\Personal\\SyncClients' => $baseDir . '/../lib/Sections/Personal/SyncClients.php',

apps/settings/composer/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class ComposerStaticInitSettings
6464
'OCA\\Settings\\Sections\\Admin\\Server' => __DIR__ . '/..' . '/../lib/Sections/Admin/Server.php',
6565
'OCA\\Settings\\Sections\\Admin\\Sharing' => __DIR__ . '/..' . '/../lib/Sections/Admin/Sharing.php',
6666
'OCA\\Settings\\Sections\\Personal\\Availability' => __DIR__ . '/..' . '/../lib/Sections/Personal/Availability.php',
67+
'OCA\\Settings\\Sections\\Personal\\Calendar' => __DIR__ . '/..' . '/../lib/Sections/Personal/Calendar.php',
6768
'OCA\\Settings\\Sections\\Personal\\PersonalInfo' => __DIR__ . '/..' . '/../lib/Sections/Personal/PersonalInfo.php',
6869
'OCA\\Settings\\Sections\\Personal\\Security' => __DIR__ . '/..' . '/../lib/Sections/Personal/Security.php',
6970
'OCA\\Settings\\Sections\\Personal\\SyncClients' => __DIR__ . '/..' . '/../lib/Sections/Personal/SyncClients.php',
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
7+
*
8+
* Mail
9+
*
10+
* This code is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU Affero General Public License, version 3,
12+
* as published by the Free Software Foundation.
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, version 3,
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>
21+
*
22+
*/
23+
24+
namespace OCA\Settings\Sections\Personal;
25+
26+
use OCP\IL10N;
27+
use OCP\IURLGenerator;
28+
use OCP\Settings\IIconSection;
29+
30+
class Calendar implements IIconSection {
31+
32+
private IL10N $l;
33+
private IURLGenerator $urlGenerator;
34+
35+
public function __construct(IL10N $l, IURLGenerator $urlGenerator) {
36+
$this->l = $l;
37+
$this->urlGenerator = $urlGenerator;
38+
}
39+
40+
public function getIcon(): string {
41+
return $this->urlGenerator->imagePath('core', 'caldav/time.svg');
42+
}
43+
44+
public function getID(): string {
45+
return 'calendar';
46+
}
47+
48+
public function getName(): string {
49+
return $this->l->t('Calendar');
50+
}
51+
52+
public function getPriority(): int {
53+
return 50;
54+
}
55+
}

0 commit comments

Comments
 (0)