1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00
phorge-phorge/src/applications/people/config/PhabricatorUserConfigOptions.php
Chad Little ae7dc8b9d2 Add getGroup to ConfigOptions
Summary: Adds core and apps grouping to configuration options, makes it somewhat easier to browse config options.

Test Plan: Set each option, review list. Breakdown is nearly 50/50 apps/core.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11722
2015-02-09 13:10:56 -08:00

57 lines
1.7 KiB
PHP

<?php
final class PhabricatorUserConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht('User Profiles');
}
public function getDescription() {
return pht('User profiles configuration.');
}
public function getFontIcon() {
return 'fa-users';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$default = array(
id(new PhabricatorUserRealNameField())->getFieldKey() => true,
id(new PhabricatorUserTitleField())->getFieldKey() => true,
id(new PhabricatorUserSinceField())->getFieldKey() => true,
id(new PhabricatorUserRolesField())->getFieldKey() => true,
id(new PhabricatorUserStatusField())->getFieldKey() => true,
id(new PhabricatorUserBlurbField())->getFieldKey() => true,
);
foreach ($default as $key => $enabled) {
$default[$key] = array(
'disabled' => !$enabled,
);
}
$custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType';
return array(
$this->newOption('user.fields', $custom_field_type, $default)
->setCustomData(id(new PhabricatorUser())->getCustomFieldBaseClass())
->setDescription(pht('Select and reorder user profile fields.')),
$this->newOption('user.custom-field-definitions', 'map', array())
->setDescription(pht('Add new simple fields to user profiles.')),
$this->newOption('user.require-real-name', 'bool', true)
->setDescription(pht('Always require real name for user profiles.'))
->setBoolOptions(
array(
pht('Make real names required'),
pht('Make real names optional'),
)),
);
}
}