@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 PhabricatorDivinerApplication extends PhabricatorApplication {
4
5 public function getBaseURI() {
6 return '/diviner/';
7 }
8
9 public function getIcon() {
10 return 'fa-sun-o';
11 }
12
13 public function getName() {
14 return pht('Diviner');
15 }
16
17 public function getShortDescription() {
18 return pht('Documentation');
19 }
20
21 public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
22 return array(
23 array(
24 'name' => pht('Diviner User Guide'),
25 'href' => PhabricatorEnv::getDoclink('Diviner User Guide'),
26 ),
27 );
28 }
29
30 public function getTitleGlyph() {
31 return "\xE2\x97\x89";
32 }
33
34 public function getRoutes() {
35 return array(
36 '/diviner/' => array(
37 '' => 'DivinerMainController',
38 'query/((?<queryKey>[^/]+)/)?' => 'DivinerAtomListController',
39 'find/' => 'DivinerFindController',
40 ),
41 '/book/(?P<book>[^/]+)/' => 'DivinerBookController',
42 '/book/(?P<book>[^/]+)/edit/' => 'DivinerBookEditController',
43 '/book/'.
44 '(?P<book>[^/]+)/'.
45 '(?P<type>[^/]+)/'.
46 '(?:(?P<context>[^/]+)/)?'.
47 '(?P<name>[^/]+)/'.
48 '(?:(?P<index>\d+)/)?' => 'DivinerAtomController',
49 );
50 }
51
52 public function getApplicationGroup() {
53 return self::GROUP_UTILITIES;
54 }
55
56 protected function getCustomCapabilities() {
57 return array(
58 DivinerDefaultViewCapability::CAPABILITY => array(
59 'template' => DivinerBookPHIDType::TYPECONST,
60 'capability' => PhabricatorPolicyCapability::CAN_VIEW,
61 ),
62 DivinerDefaultEditCapability::CAPABILITY => array(
63 'default' => PhabricatorPolicies::POLICY_ADMIN,
64 'template' => DivinerBookPHIDType::TYPECONST,
65 'capability' => PhabricatorPolicyCapability::CAN_EDIT,
66 ),
67 );
68 }
69
70 public function getRemarkupRules() {
71 return array(
72 new DivinerSymbolRemarkupRule(),
73 );
74 }
75
76 public function getApplicationSearchDocumentTypes() {
77 return array(
78 DivinerAtomPHIDType::TYPECONST,
79 DivinerBookPHIDType::TYPECONST,
80 );
81 }
82
83}