1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-08 02:18:33 +02:00
phorge-phorge/src/applications/project/config/PhabricatorProjectConfigOptions.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

51 lines
1.3 KiB
PHP

<?php
final class PhabricatorProjectConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht('Projects');
}
public function getDescription() {
return pht('Configure Projects.');
}
public function getFontIcon() {
return 'fa-briefcase';
}
public function getGroup() {
return 'apps';
}
public function getOptions() {
$default_fields = array(
'std:project:internal:description' => true,
);
foreach ($default_fields as $key => $enabled) {
$default_fields[$key] = array(
'disabled' => !$enabled,
);
}
$custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType';
return array(
$this->newOption('projects.custom-field-definitions', 'wild', array())
->setSummary(pht('Custom Projects fields.'))
->setDescription(
pht(
'Array of custom fields for Projects.'))
->addExample(
'{"mycompany:motto": {"name": "Project Motto", '.
'"type": "text"}}',
pht('Valid Setting')),
$this->newOption('projects.fields', $custom_field_type, $default_fields)
->setCustomData(id(new PhabricatorProject())->getCustomFieldBaseClass())
->setDescription(pht('Select and reorder project fields.')),
);
}
}