Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / people / customfield / PhabricatorUserRolesField.php
blobf68ea6c3c555580e586e987e23dfc37003e065e3
1 <?php
3 final class PhabricatorUserRolesField
4 extends PhabricatorUserCustomField {
6 private $value;
8 public function getFieldKey() {
9 return 'user:roles';
12 public function getFieldName() {
13 return pht('Roles');
16 public function getFieldDescription() {
17 return pht('Shows roles like "Administrator" and "Disabled".');
20 public function shouldAppearInPropertyView() {
21 return true;
24 public function renderPropertyViewValue(array $handles) {
25 $user = $this->getObject();
27 $roles = array();
28 if ($user->getIsAdmin()) {
29 $roles[] = pht('Administrator');
31 if ($user->getIsDisabled()) {
32 $roles[] = pht('Disabled');
34 if (!$user->getIsApproved()) {
35 $roles[] = pht('Not Approved');
37 if ($user->getIsSystemAgent()) {
38 $roles[] = pht('Bot');
40 if ($user->getIsMailingList()) {
41 $roles[] = pht('Mailing List');
44 if ($roles) {
45 return implode(', ', $roles);
48 return null;