mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 09:42:41 +01:00
1582bb54f6
Summary: Currently, Version numbers are sort of randomly shown on "All Settings" beacuse we didn't have any better place to put them. Now that we have modules, expose them as a config module. Test Plan: {F906426} Grepped for "all settings" to look for other references to the old location, but didn't get any relevant hits. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D14327
75 lines
1.8 KiB
PHP
75 lines
1.8 KiB
PHP
<?php
|
|
|
|
final class PhabricatorConfigAllController
|
|
extends PhabricatorConfigController {
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$viewer = $request->getViewer();
|
|
|
|
$db_values = id(new PhabricatorConfigEntry())
|
|
->loadAllWhere('namespace = %s', 'default');
|
|
$db_values = mpull($db_values, null, 'getConfigKey');
|
|
|
|
$rows = array();
|
|
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
|
|
ksort($options);
|
|
foreach ($options as $option) {
|
|
$key = $option->getKey();
|
|
|
|
if ($option->getHidden()) {
|
|
$value = phutil_tag('em', array(), pht('Hidden'));
|
|
} else {
|
|
$value = PhabricatorEnv::getEnvConfig($key);
|
|
$value = PhabricatorConfigJSON::prettyPrintJSON($value);
|
|
}
|
|
|
|
$db_value = idx($db_values, $key);
|
|
$rows[] = array(
|
|
phutil_tag(
|
|
'a',
|
|
array(
|
|
'href' => $this->getApplicationURI('edit/'.$key.'/'),
|
|
),
|
|
$key),
|
|
$value,
|
|
$db_value && !$db_value->getIsDeleted() ? pht('Customized') : '',
|
|
);
|
|
}
|
|
$table = id(new AphrontTableView($rows))
|
|
->setColumnClasses(
|
|
array(
|
|
'',
|
|
'wide',
|
|
))
|
|
->setHeaders(
|
|
array(
|
|
pht('Key'),
|
|
pht('Value'),
|
|
pht('Customized'),
|
|
));
|
|
|
|
$title = pht('Current Settings');
|
|
|
|
$crumbs = $this
|
|
->buildApplicationCrumbs()
|
|
->addTextCrumb($title);
|
|
|
|
$panel = new PHUIObjectBoxView();
|
|
$panel->setHeaderText(pht('Current Settings'));
|
|
$panel->setTable($table);
|
|
|
|
|
|
$nav = $this->buildSideNavView();
|
|
$nav->selectFilter('all/');
|
|
$nav->setCrumbs($crumbs);
|
|
$nav->appendChild($panel);
|
|
|
|
|
|
return $this->buildApplicationPage(
|
|
$nav,
|
|
array(
|
|
'title' => $title,
|
|
));
|
|
}
|
|
|
|
}
|