2013-01-16 20:10:41 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorConfigAllController
|
|
|
|
extends PhabricatorConfigController {
|
|
|
|
|
2015-07-27 18:06:26 +02:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $request->getViewer();
|
2013-01-16 20:10:41 +01:00
|
|
|
|
2013-04-13 18:31:24 +02:00
|
|
|
$db_values = id(new PhabricatorConfigEntry())
|
|
|
|
->loadAllWhere('namespace = %s', 'default');
|
|
|
|
$db_values = mpull($db_values, null, 'getConfigKey');
|
|
|
|
|
2013-01-16 20:10:41 +01:00
|
|
|
$rows = array();
|
|
|
|
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
|
2013-01-16 20:39:13 +01:00
|
|
|
ksort($options);
|
2013-01-16 20:10:41 +01:00
|
|
|
foreach ($options as $option) {
|
|
|
|
$key = $option->getKey();
|
|
|
|
|
2015-02-13 19:59:50 +01:00
|
|
|
if ($option->getHidden()) {
|
2013-02-13 23:50:15 +01:00
|
|
|
$value = phutil_tag('em', array(), pht('Hidden'));
|
2013-01-16 20:10:41 +01:00
|
|
|
} else {
|
|
|
|
$value = PhabricatorEnv::getEnvConfig($key);
|
|
|
|
$value = PhabricatorConfigJSON::prettyPrintJSON($value);
|
|
|
|
}
|
|
|
|
|
2013-04-13 18:31:24 +02:00
|
|
|
$db_value = idx($db_values, $key);
|
2013-01-16 20:10:41 +01:00
|
|
|
$rows[] = array(
|
2013-01-18 03:43:35 +01:00
|
|
|
phutil_tag(
|
2013-01-16 20:10:41 +01:00
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => $this->getApplicationURI('edit/'.$key.'/'),
|
|
|
|
),
|
2013-01-18 03:43:35 +01:00
|
|
|
$key),
|
2013-01-16 20:10:41 +01:00
|
|
|
$value,
|
2013-04-13 18:31:24 +02:00
|
|
|
$db_value && !$db_value->getIsDeleted() ? pht('Customized') : '',
|
2013-01-16 20:10:41 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
$table = id(new AphrontTableView($rows))
|
|
|
|
->setColumnClasses(
|
|
|
|
array(
|
|
|
|
'',
|
|
|
|
'wide',
|
|
|
|
))
|
|
|
|
->setHeaders(
|
|
|
|
array(
|
|
|
|
pht('Key'),
|
|
|
|
pht('Value'),
|
2013-04-13 18:31:24 +02:00
|
|
|
pht('Customized'),
|
2013-01-16 20:10:41 +01:00
|
|
|
));
|
|
|
|
|
|
|
|
$title = pht('Current Settings');
|
|
|
|
|
|
|
|
$crumbs = $this
|
|
|
|
->buildApplicationCrumbs()
|
2013-12-19 02:47:34 +01:00
|
|
|
->addTextCrumb($title);
|
2013-01-16 20:10:41 +01:00
|
|
|
|
2014-06-27 17:28:33 +02:00
|
|
|
$panel = new PHUIObjectBoxView();
|
|
|
|
$panel->setHeaderText(pht('Current Settings'));
|
[Redesign] Add Table, Collapse support to ObjectBox
Summary: Converts most all tables to be directly set via `setTable` to an ObjectBox. I think this path is more flexible design wise, as we can change the box based on children, and not just CSS. We also already do this with PropertyList, Forms, ObjectList, and Header. `setCollapsed` is added to ObjectBox to all children objects to bleed to the edges (like diffs).
Test Plan: I did a grep of `appendChild($table)` as well as searches for `PHUIObjectBoxView`, also with manual opening of hundreds of files. I'm sure I missed 5-8 places. If you just appendChild($table) nothing breaks, it just looks a little funny.
Reviewers: epriestley, btrahan
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12955
2015-05-20 21:43:34 +02:00
|
|
|
$panel->setTable($table);
|
2013-01-19 03:08:06 +01:00
|
|
|
|
2013-01-19 19:24:46 +01:00
|
|
|
|
2013-01-16 20:10:41 +01:00
|
|
|
$nav = $this->buildSideNavView();
|
|
|
|
$nav->selectFilter('all/');
|
|
|
|
$nav->setCrumbs($crumbs);
|
2013-01-19 03:08:06 +01:00
|
|
|
$nav->appendChild($panel);
|
2013-01-16 20:10:41 +01:00
|
|
|
|
2013-01-19 19:24:46 +01:00
|
|
|
|
2013-01-16 20:10:41 +01:00
|
|
|
return $this->buildApplicationPage(
|
|
|
|
$nav,
|
|
|
|
array(
|
|
|
|
'title' => $title,
|
2013-02-19 22:33:10 +01:00
|
|
|
));
|
2013-01-16 20:10:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|