mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-28 12:08:14 +01:00
Summary: Mostly a minor nit-pick, but I hate sending users off the profile and disorient them onto application search. These pages are pretty easy to maintain, I don't expect to need to do more here. I dropped Differential outright. Kept Tasks and Commits. Now you can browse everything about a user on their profile without leaving. Maybe add a link to ApplicationSearch? Not sure it's important. Test Plan: Review tasks and commits on mine and other user profiles. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17470
107 lines
3.2 KiB
PHP
107 lines
3.2 KiB
PHP
<?php
|
|
|
|
final class PhabricatorPeopleApplication extends PhabricatorApplication {
|
|
|
|
public function getName() {
|
|
return pht('People');
|
|
}
|
|
|
|
public function getShortDescription() {
|
|
return pht('User Accounts and Profiles');
|
|
}
|
|
|
|
public function getBaseURI() {
|
|
return '/people/';
|
|
}
|
|
|
|
public function getTitleGlyph() {
|
|
return "\xE2\x99\x9F";
|
|
}
|
|
|
|
public function getIcon() {
|
|
return 'fa-users';
|
|
}
|
|
|
|
public function isPinnedByDefault(PhabricatorUser $viewer) {
|
|
return $viewer->getIsAdmin();
|
|
}
|
|
|
|
public function getFlavorText() {
|
|
return pht('Sort of a social utility.');
|
|
}
|
|
|
|
public function getApplicationGroup() {
|
|
return self::GROUP_UTILITIES;
|
|
}
|
|
|
|
public function canUninstall() {
|
|
return false;
|
|
}
|
|
|
|
public function getRoutes() {
|
|
return array(
|
|
'/people/' => array(
|
|
'(query/(?P<key>[^/]+)/)?' => 'PhabricatorPeopleListController',
|
|
'logs/(?:query/(?P<queryKey>[^/]+)/)?'
|
|
=> 'PhabricatorPeopleLogsController',
|
|
'invite/' => array(
|
|
'(?:query/(?P<queryKey>[^/]+)/)?'
|
|
=> 'PhabricatorPeopleInviteListController',
|
|
'send/'
|
|
=> 'PhabricatorPeopleInviteSendController',
|
|
),
|
|
'approve/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleApproveController',
|
|
'(?P<via>disapprove)/(?P<id>[1-9]\d*)/'
|
|
=> 'PhabricatorPeopleDisableController',
|
|
'(?P<via>disable)/(?P<id>[1-9]\d*)/'
|
|
=> 'PhabricatorPeopleDisableController',
|
|
'empower/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleEmpowerController',
|
|
'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleDeleteController',
|
|
'rename/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleRenameController',
|
|
'welcome/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleWelcomeController',
|
|
'create/' => 'PhabricatorPeopleCreateController',
|
|
'new/(?P<type>[^/]+)/' => 'PhabricatorPeopleNewController',
|
|
'ldap/' => 'PhabricatorPeopleLdapController',
|
|
'editprofile/(?P<id>[1-9]\d*)/' =>
|
|
'PhabricatorPeopleProfileEditController',
|
|
'badges/(?P<id>[1-9]\d*)/' =>
|
|
'PhabricatorPeopleProfileBadgesController',
|
|
'tasks/(?P<id>[1-9]\d*)/' =>
|
|
'PhabricatorPeopleProfileTasksController',
|
|
'commits/(?P<id>[1-9]\d*)/' =>
|
|
'PhabricatorPeopleProfileCommitsController',
|
|
'picture/(?P<id>[1-9]\d*)/' =>
|
|
'PhabricatorPeopleProfilePictureController',
|
|
'manage/(?P<id>[1-9]\d*)/' =>
|
|
'PhabricatorPeopleProfileManageController',
|
|
),
|
|
'/p/(?P<username>[\w._-]+)/' => array(
|
|
'' => 'PhabricatorPeopleProfileViewController',
|
|
'item/' => $this->getProfileMenuRouting(
|
|
'PhabricatorPeopleProfileMenuController'),
|
|
),
|
|
);
|
|
}
|
|
|
|
public function getRemarkupRules() {
|
|
return array(
|
|
new PhabricatorMentionRemarkupRule(),
|
|
);
|
|
}
|
|
|
|
protected function getCustomCapabilities() {
|
|
return array(
|
|
PeopleCreateUsersCapability::CAPABILITY => array(
|
|
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
|
),
|
|
PeopleBrowseUserDirectoryCapability::CAPABILITY => array(),
|
|
);
|
|
}
|
|
|
|
public function getApplicationSearchDocumentTypes() {
|
|
return array(
|
|
PhabricatorPeopleUserPHIDType::TYPECONST,
|
|
);
|
|
}
|
|
|
|
}
|