@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final 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 getMonograms() {
53 return array('H');
54 }
55
56 public function getRoutes() {
57 return array(
58 '/H(?P<id>[1-9]\d*)' => 'HeraldRuleViewController',
59 '/herald/' => array(
60 '(?:query/(?P<queryKey>[^/]+)/)?' => 'HeraldRuleListController',
61 'new/' => 'HeraldNewController',
62 'create/' => 'HeraldNewController',
63 'edit/(?:(?P<id>[1-9]\d*)/)?' => 'HeraldRuleController',
64 'disable/(?P<id>[1-9]\d*)/(?P<action>[^/]+)/'
65 => 'HeraldDisableController',
66 'test/' => 'HeraldTestConsoleController',
67 'transcript/' => array(
68 '' => 'HeraldTranscriptListController',
69 '(?:query/(?P<queryKey>[^/]+)/)?' => 'HeraldTranscriptListController',
70 '(?P<id>[1-9]\d*)/(?:(?P<view>[^/]+)/)?'
71 => 'HeraldTranscriptController',
72 ),
73 'webhook/' => array(
74 $this->getQueryRoutePattern() => 'HeraldWebhookListController',
75 'view/(?P<id>\d+)/(?:request/(?P<requestID>[^/]+)/)?' =>
76 'HeraldWebhookViewController',
77 $this->getEditRoutePattern('edit/') => 'HeraldWebhookEditController',
78 'test/(?P<id>\d+)/' => 'HeraldWebhookTestController',
79 'key/(?P<action>view|cycle)/(?P<id>\d+)/' =>
80 'HeraldWebhookKeyController',
81 ),
82 ),
83 );
84 }
85
86 protected function getCustomCapabilities() {
87 return array(
88 HeraldManageGlobalRulesCapability::CAPABILITY => array(
89 'caption' => pht('Global rules can bypass access controls.'),
90 'default' => PhabricatorPolicies::POLICY_ADMIN,
91 ),
92 HeraldCreateWebhooksCapability::CAPABILITY => array(
93 'default' => PhabricatorPolicies::POLICY_ADMIN,
94 ),
95 );
96 }
97
98}