Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/people/config/PhabricatorUserConfigOptions.php
12256 views
1
<?php
2
3
final class PhabricatorUserConfigOptions
4
extends PhabricatorApplicationConfigOptions {
5
6
public function getName() {
7
return pht('User Profiles');
8
}
9
10
public function getDescription() {
11
return pht('User profiles configuration.');
12
}
13
14
public function getIcon() {
15
return 'fa-users';
16
}
17
18
public function getGroup() {
19
return 'apps';
20
}
21
22
public function getOptions() {
23
24
$default = array(
25
id(new PhabricatorUserRealNameField())->getFieldKey() => true,
26
id(new PhabricatorUserTitleField())->getFieldKey() => true,
27
id(new PhabricatorUserIconField())->getFieldKey() => true,
28
id(new PhabricatorUserSinceField())->getFieldKey() => true,
29
id(new PhabricatorUserRolesField())->getFieldKey() => true,
30
id(new PhabricatorUserStatusField())->getFieldKey() => true,
31
id(new PhabricatorUserBlurbField())->getFieldKey() => true,
32
);
33
34
foreach ($default as $key => $enabled) {
35
$default[$key] = array(
36
'disabled' => !$enabled,
37
);
38
}
39
40
$custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType';
41
42
return array(
43
$this->newOption('user.fields', $custom_field_type, $default)
44
->setCustomData(id(new PhabricatorUser())->getCustomFieldBaseClass())
45
->setDescription(pht('Select and reorder user profile fields.')),
46
$this->newOption('user.custom-field-definitions', 'wild', array())
47
->setDescription(pht('Add new simple fields to user profiles.')),
48
$this->newOption('user.require-real-name', 'bool', true)
49
->setDescription(pht('Always require real name for user profiles.'))
50
->setBoolOptions(
51
array(
52
pht('Make real names required'),
53
pht('Make real names optional'),
54
)),
55
);
56
}
57
58
}
59
60