2015-07-22 22:37:20 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorBadgesApplication extends PhabricatorApplication {
|
|
|
|
|
|
|
|
public function getName() {
|
|
|
|
return pht('Badges');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBaseURI() {
|
|
|
|
return '/badges/';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getShortDescription() {
|
|
|
|
return pht('Achievements and Notority');
|
|
|
|
}
|
|
|
|
|
2016-01-28 17:40:22 +01:00
|
|
|
public function getIcon() {
|
2015-07-22 22:37:20 +02:00
|
|
|
return 'fa-trophy';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFlavorText() {
|
|
|
|
return pht('Build self esteem through gamification.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getApplicationGroup() {
|
|
|
|
return self::GROUP_UTILITIES;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isPrototype() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
|
|
|
'/badges/' => array(
|
|
|
|
'(?:query/(?P<queryKey>[^/]+)/)?'
|
|
|
|
=> 'PhabricatorBadgesListController',
|
2016-03-31 22:39:06 +02:00
|
|
|
'award/(?:(?P<id>\d+)/)?'
|
|
|
|
=> 'PhabricatorBadgesAwardController',
|
2015-07-22 22:37:20 +02:00
|
|
|
'create/'
|
|
|
|
=> 'PhabricatorBadgesEditController',
|
2015-07-24 19:56:08 +02:00
|
|
|
'comment/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorBadgesCommentController',
|
2016-04-01 02:29:32 +02:00
|
|
|
$this->getEditRoutePattern('edit/')
|
|
|
|
=> 'PhabricatorBadgesEditController',
|
2015-12-09 22:26:26 +01:00
|
|
|
'archive/(?:(?P<id>\d+)/)?'
|
|
|
|
=> 'PhabricatorBadgesArchiveController',
|
2015-07-22 22:37:20 +02:00
|
|
|
'view/(?:(?P<id>\d+)/)?'
|
|
|
|
=> 'PhabricatorBadgesViewController',
|
|
|
|
'recipients/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorBadgesEditRecipientsController',
|
|
|
|
'recipients/(?P<id>[1-9]\d*)/remove/'
|
|
|
|
=> 'PhabricatorBadgesRemoveRecipientsController',
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getCustomCapabilities() {
|
|
|
|
return array(
|
|
|
|
PhabricatorBadgesCreateCapability::CAPABILITY => array(
|
|
|
|
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
|
|
|
'caption' => pht('Default create policy for badges.'),
|
|
|
|
),
|
|
|
|
PhabricatorBadgesDefaultEditCapability::CAPABILITY => array(
|
|
|
|
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
|
|
|
'caption' => pht('Default edit policy for badges.'),
|
|
|
|
'template' => PhabricatorBadgesPHIDType::TYPECONST,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|