Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/herald/application/PhabricatorHeraldApplication.php
12256 views
1
<?php
2
3
final class PhabricatorHeraldApplication extends PhabricatorApplication {
4
5
public function getBaseURI() {
6
return '/herald/';
7
}
8
9
public function getIcon() {
10
return 'fa-bullhorn';
11
}
12
13
public function getName() {
14
return pht('Herald');
15
}
16
17
public function getShortDescription() {
18
return pht('Create Notification Rules');
19
}
20
21
public function getTitleGlyph() {
22
return "\xE2\x98\xBF";
23
}
24
25
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
26
return array(
27
array(
28
'name' => pht('Herald User Guide'),
29
'href' => PhabricatorEnv::getDoclink('Herald User Guide'),
30
),
31
array(
32
'name' => pht('User Guide: Webhooks'),
33
'href' => PhabricatorEnv::getDoclink('User Guide: Webhooks'),
34
),
35
);
36
}
37
38
public function getFlavorText() {
39
return pht('Watch for danger!');
40
}
41
42
public function getApplicationGroup() {
43
return self::GROUP_UTILITIES;
44
}
45
46
public function getRemarkupRules() {
47
return array(
48
new HeraldRemarkupRule(),
49
);
50
}
51
52
public function getRoutes() {
53
return array(
54
'/H(?P<id>[1-9]\d*)' => 'HeraldRuleViewController',
55
'/herald/' => array(
56
'(?:query/(?P<queryKey>[^/]+)/)?' => 'HeraldRuleListController',
57
'new/' => 'HeraldNewController',
58
'create/' => 'HeraldNewController',
59
'edit/(?:(?P<id>[1-9]\d*)/)?' => 'HeraldRuleController',
60
'disable/(?P<id>[1-9]\d*)/(?P<action>[^/]+)/'
61
=> 'HeraldDisableController',
62
'test/' => 'HeraldTestConsoleController',
63
'transcript/' => array(
64
'' => 'HeraldTranscriptListController',
65
'(?:query/(?P<queryKey>[^/]+)/)?' => 'HeraldTranscriptListController',
66
'(?P<id>[1-9]\d*)/(?:(?P<view>[^/]+)/)?'
67
=> 'HeraldTranscriptController',
68
),
69
'webhook/' => array(
70
$this->getQueryRoutePattern() => 'HeraldWebhookListController',
71
'view/(?P<id>\d+)/(?:request/(?P<requestID>[^/]+)/)?' =>
72
'HeraldWebhookViewController',
73
$this->getEditRoutePattern('edit/') => 'HeraldWebhookEditController',
74
'test/(?P<id>\d+)/' => 'HeraldWebhookTestController',
75
'key/(?P<action>view|cycle)/(?P<id>\d+)/' =>
76
'HeraldWebhookKeyController',
77
),
78
),
79
);
80
}
81
82
protected function getCustomCapabilities() {
83
return array(
84
HeraldManageGlobalRulesCapability::CAPABILITY => array(
85
'caption' => pht('Global rules can bypass access controls.'),
86
'default' => PhabricatorPolicies::POLICY_ADMIN,
87
),
88
HeraldCreateWebhooksCapability::CAPABILITY => array(
89
'default' => PhabricatorPolicies::POLICY_ADMIN,
90
),
91
);
92
}
93
94
}
95
96