-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinks.php
137 lines (108 loc) · 3.48 KB
/
Links.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/* Icinga Notifications Web | (c) 2023 Icinga GmbH | GPLv2 */
namespace Icinga\Module\Notifications\Common;
use ipl\Web\Url;
/**
* This class provides all module related links
*/
abstract class Links
{
public static function event(?int $id = null): Url
{
if ($id === null) {
return Url::fromPath('notifications/event');
}
return Url::fromPath('notifications/event', ['id' => $id]);
}
public static function events(): Url
{
return Url::fromPath('notifications/events');
}
public static function incidents(): Url
{
return Url::fromPath('notifications/incidents');
}
public static function incident(?int $id = null): Url
{
if ($id === null) {
return Url::fromPath('notifications/incident');
}
return Url::fromPath('notifications/incident', ['id' => $id]);
}
public static function contacts(): Url
{
return Url::fromPath('notifications/contacts');
}
public static function contact(?int $id = null): Url
{
if ($id === null) {
return Url::fromPath('notifications/contact');
}
return Url::fromPath('notifications/contact', ['id' => $id]);
}
public static function eventRules(): Url
{
return Url::fromPath('notifications/event-rules');
}
public static function eventRule(?int $id = null): Url
{
if ($id === null) {
return Url::fromPath('notifications/event-rule');
}
return Url::fromPath('notifications/event-rule', ['id' => $id]);
}
public static function schedules(): Url
{
return Url::fromPath('notifications/schedules');
}
public static function schedule(?int $id = null): Url
{
if ($id === null) {
return Url::fromPath('notifications/schedule');
}
return Url::fromPath('notifications/schedule', ['id' => $id]);
}
public static function scheduleAdd(): Url
{
return Url::fromPath('notifications/schedule/add');
}
public static function scheduleSettings(int $id): Url
{
return Url::fromPath('notifications/schedule/settings', ['id' => $id]);
}
public static function contactGroups(): Url
{
return Url::fromPath('notifications/contact-groups');
}
public static function contactGroupsAdd(): Url
{
return Url::fromPath('notifications/contact-groups/add');
}
public static function contactGroupsSuggestMember(): Url
{
return Url::fromPath('notifications/contact-groups/suggest-member');
}
public static function contactGroup(?int $id = null): Url
{
if ($id === null) {
return Url::fromPath('notifications/contact-group');
}
return Url::fromPath('notifications/contact-group', ['id' => $id]);
}
public static function contactGroupEdit(int $id): Url
{
return Url::fromPath('notifications/contact-group/edit', ['id' => $id]);
}
public static function rotationAdd(int $scheduleId): Url
{
return Url::fromPath('notifications/schedule/add-rotation', ['schedule' => $scheduleId]);
}
public static function rotationSettings(int $id, int $scheduleId): Url
{
return Url::fromPath('notifications/schedule/edit-rotation', ['id' => $id, 'schedule' => $scheduleId]);
}
public static function moveRotation(): Url
{
return Url::fromPath('notifications/schedule/move-rotation');
}
}