Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/application/PhabricatorCalendarApplication.php
12253 views
1
<?php
2
3
final class PhabricatorCalendarApplication extends PhabricatorApplication {
4
5
public function getName() {
6
return pht('Calendar');
7
}
8
9
public function getShortDescription() {
10
return pht('Upcoming Events');
11
}
12
13
public function getFlavorText() {
14
return pht('Never miss an episode ever again.');
15
}
16
17
public function getBaseURI() {
18
return '/calendar/';
19
}
20
21
public function getIcon() {
22
return 'fa-calendar';
23
}
24
25
public function getTitleGlyph() {
26
// Unicode has a calendar character but it's in some distant code plane,
27
// use "keyboard" since it looks vaguely similar.
28
return "\xE2\x8C\xA8";
29
}
30
31
public function getApplicationGroup() {
32
return self::GROUP_UTILITIES;
33
}
34
35
public function isPrototype() {
36
return true;
37
}
38
39
public function getRemarkupRules() {
40
return array(
41
new PhabricatorCalendarRemarkupRule(),
42
);
43
}
44
45
public function getRoutes() {
46
return array(
47
'/E(?P<id>[1-9]\d*)(?:/(?P<sequence>\d+)/)?'
48
=> 'PhabricatorCalendarEventViewController',
49
'/calendar/' => array(
50
'(?:query/(?P<queryKey>[^/]+)/(?:(?P<year>\d+)/'.
51
'(?P<month>\d+)/)?(?:(?P<day>\d+)/)?)?'
52
=> 'PhabricatorCalendarEventListController',
53
'event/' => array(
54
$this->getEditRoutePattern('edit/')
55
=> 'PhabricatorCalendarEventEditController',
56
'drag/(?P<id>[1-9]\d*)/'
57
=> 'PhabricatorCalendarEventDragController',
58
'cancel/(?P<id>[1-9]\d*)/'
59
=> 'PhabricatorCalendarEventCancelController',
60
'(?P<action>join|decline|accept)/(?P<id>[1-9]\d*)/'
61
=> 'PhabricatorCalendarEventJoinController',
62
'export/(?P<id>[1-9]\d*)/(?P<filename>[^/]*)'
63
=> 'PhabricatorCalendarEventExportController',
64
'availability/(?P<id>[1-9]\d*)/(?P<availability>[^/]+)/'
65
=> 'PhabricatorCalendarEventAvailabilityController',
66
),
67
'export/' => array(
68
$this->getQueryRoutePattern()
69
=> 'PhabricatorCalendarExportListController',
70
$this->getEditRoutePattern('edit/')
71
=> 'PhabricatorCalendarExportEditController',
72
'(?P<id>[1-9]\d*)/'
73
=> 'PhabricatorCalendarExportViewController',
74
'ics/(?P<secretKey>[^/]+)/(?P<filename>[^/]*)'
75
=> 'PhabricatorCalendarExportICSController',
76
'disable/(?P<id>[1-9]\d*)/'
77
=> 'PhabricatorCalendarExportDisableController',
78
),
79
'import/' => array(
80
$this->getQueryRoutePattern()
81
=> 'PhabricatorCalendarImportListController',
82
$this->getEditRoutePattern('edit/')
83
=> 'PhabricatorCalendarImportEditController',
84
'(?P<id>[1-9]\d*)/'
85
=> 'PhabricatorCalendarImportViewController',
86
'disable/(?P<id>[1-9]\d*)/'
87
=> 'PhabricatorCalendarImportDisableController',
88
'delete/(?P<id>[1-9]\d*)/'
89
=> 'PhabricatorCalendarImportDeleteController',
90
'reload/(?P<id>[1-9]\d*)/'
91
=> 'PhabricatorCalendarImportReloadController',
92
'drop/'
93
=> 'PhabricatorCalendarImportDropController',
94
'log/' => array(
95
$this->getQueryRoutePattern()
96
=> 'PhabricatorCalendarImportLogListController',
97
),
98
),
99
),
100
);
101
}
102
103
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
104
return array(
105
array(
106
'name' => pht('Calendar User Guide'),
107
'href' => PhabricatorEnv::getDoclink('Calendar User Guide'),
108
),
109
array(
110
'name' => pht('Importing Events'),
111
'href' => PhabricatorEnv::getDoclink(
112
'Calendar User Guide: Importing Events'),
113
),
114
array(
115
'name' => pht('Exporting Events'),
116
'href' => PhabricatorEnv::getDoclink(
117
'Calendar User Guide: Exporting Events'),
118
),
119
);
120
}
121
122
public function getMailCommandObjects() {
123
return array(
124
'event' => array(
125
'name' => pht('Email Commands: Events'),
126
'header' => pht('Interacting with Calendar Events'),
127
'object' => new PhabricatorCalendarEvent(),
128
'summary' => pht(
129
'This page documents the commands you can use to interact with '.
130
'events in Calendar. These commands work when creating new tasks '.
131
'via email and when replying to existing tasks.'),
132
),
133
);
134
}
135
136
protected function getCustomCapabilities() {
137
return array(
138
PhabricatorCalendarEventDefaultViewCapability::CAPABILITY => array(
139
'caption' => pht('Default view policy for newly created events.'),
140
'template' => PhabricatorCalendarEventPHIDType::TYPECONST,
141
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
142
),
143
PhabricatorCalendarEventDefaultEditCapability::CAPABILITY => array(
144
'caption' => pht('Default edit policy for newly created events.'),
145
'template' => PhabricatorCalendarEventPHIDType::TYPECONST,
146
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
147
),
148
);
149
}
150
151
}
152
153