2013-06-07 19:22:45 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorUserConfigOptions
|
|
|
|
extends PhabricatorApplicationConfigOptions {
|
|
|
|
|
|
|
|
public function getName() {
|
|
|
|
return pht("User Profiles");
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDescription() {
|
|
|
|
return pht("User profiles configuration.");
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getOptions() {
|
|
|
|
|
|
|
|
$default = array(
|
|
|
|
id(new PhabricatorUserRealNameField())->getFieldKey() => true,
|
|
|
|
id(new PhabricatorUserTitleField())->getFieldKey() => true,
|
2013-07-10 14:09:59 +02:00
|
|
|
id(new PhabricatorUserSinceField())->getFieldKey() => true,
|
2013-07-10 21:34:09 +02:00
|
|
|
id(new PhabricatorUserRolesField())->getFieldKey() => true,
|
|
|
|
id(new PhabricatorUserStatusField())->getFieldKey() => true,
|
2013-06-07 19:22:45 +02:00
|
|
|
id(new PhabricatorUserBlurbField())->getFieldKey() => true,
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach ($default as $key => $enabled) {
|
|
|
|
$default[$key] = array(
|
|
|
|
'disabled' => !$enabled,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2013-06-07 21:36:18 +02:00
|
|
|
$custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType';
|
|
|
|
|
2013-06-07 19:22:45 +02:00
|
|
|
return array(
|
2013-06-07 21:36:18 +02:00
|
|
|
$this->newOption('user.fields', $custom_field_type, $default)
|
|
|
|
->setCustomData(id(new PhabricatorUser())->getCustomFieldBaseClass())
|
2013-06-07 19:22:45 +02:00
|
|
|
->setDescription(pht("Select and reorder user profile fields.")),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|