Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/badges/application/PhabricatorBadgesApplication.php
12256 views
1
<?php
2
3
final class PhabricatorBadgesApplication extends PhabricatorApplication {
4
5
public function getName() {
6
return pht('Badges');
7
}
8
9
public function getBaseURI() {
10
return '/badges/';
11
}
12
13
public function getShortDescription() {
14
return pht('Achievements and Notoriety');
15
}
16
17
public function getIcon() {
18
return 'fa-trophy';
19
}
20
21
public function getFlavorText() {
22
return pht('Build self esteem through gamification.');
23
}
24
25
public function getApplicationGroup() {
26
return self::GROUP_UTILITIES;
27
}
28
29
public function getRoutes() {
30
return array(
31
'/badges/' => array(
32
'(?:query/(?P<queryKey>[^/]+)/)?'
33
=> 'PhabricatorBadgesListController',
34
'award/(?:(?P<id>\d+)/)?'
35
=> 'PhabricatorBadgesAwardController',
36
'create/'
37
=> 'PhabricatorBadgesEditController',
38
'comment/(?P<id>[1-9]\d*)/'
39
=> 'PhabricatorBadgesCommentController',
40
$this->getEditRoutePattern('edit/')
41
=> 'PhabricatorBadgesEditController',
42
'archive/(?:(?P<id>\d+)/)?'
43
=> 'PhabricatorBadgesArchiveController',
44
'view/(?:(?P<id>\d+)/)?'
45
=> 'PhabricatorBadgesViewController',
46
'recipients/' => array(
47
'(?P<id>[1-9]\d*)/'
48
=> 'PhabricatorBadgesRecipientsController',
49
'(?P<id>[1-9]\d*)/add/'
50
=> 'PhabricatorBadgesEditRecipientsController',
51
'(?P<id>[1-9]\d*)/remove/'
52
=> 'PhabricatorBadgesRemoveRecipientsController',
53
),
54
),
55
);
56
}
57
58
protected function getCustomCapabilities() {
59
return array(
60
PhabricatorBadgesCreateCapability::CAPABILITY => array(
61
'default' => PhabricatorPolicies::POLICY_ADMIN,
62
'caption' => pht('Default create policy for badges.'),
63
),
64
PhabricatorBadgesDefaultEditCapability::CAPABILITY => array(
65
'default' => PhabricatorPolicies::POLICY_ADMIN,
66
'caption' => pht('Default edit policy for badges.'),
67
'template' => PhabricatorBadgesPHIDType::TYPECONST,
68
),
69
);
70
}
71
72
}
73
74