Differential D14768 Diff 35723 src/applications/conduit/controller/PhabricatorConduitConsoleController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitConsoleController.php
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$properties = $this->buildMethodProperties($method); | $properties = $this->buildMethodProperties($method); | ||||
$info_box = id(new PHUIObjectBoxView()) | $info_box = id(new PHUIObjectBoxView()) | ||||
->setHeaderText(pht('API Method: %s', $method->getAPIMethodName())) | ->setHeaderText(pht('API Method: %s', $method->getAPIMethodName())) | ||||
->setFormErrors($errors) | ->setFormErrors($errors) | ||||
->appendChild($properties); | ->appendChild($properties); | ||||
$content[] = $info_box; | $content[] = $info_box; | ||||
$content[] = $method->getMethodDocumentation(); | |||||
$content[] = $form_box; | $content[] = $form_box; | ||||
$content[] = $this->renderExampleBox($method, null); | $content[] = $this->renderExampleBox($method, null); | ||||
$query = $method->newQueryObject(); | |||||
if ($query) { | |||||
$orders = $query->getBuiltinOrders(); | |||||
$rows = array(); | |||||
foreach ($orders as $key => $order) { | |||||
$rows[] = array( | |||||
$key, | |||||
$order['name'], | |||||
implode(', ', $order['vector']), | |||||
); | |||||
} | |||||
$table = id(new AphrontTableView($rows)) | |||||
->setHeaders( | |||||
array( | |||||
pht('Key'), | |||||
pht('Description'), | |||||
pht('Columns'), | |||||
)) | |||||
->setColumnClasses( | |||||
array( | |||||
'pri', | |||||
'', | |||||
'wide', | |||||
)); | |||||
$content[] = id(new PHUIObjectBoxView()) | |||||
->setHeaderText(pht('Builtin Orders')) | |||||
->setTable($table); | |||||
$columns = $query->getOrderableColumns(); | |||||
$rows = array(); | |||||
foreach ($columns as $key => $column) { | |||||
$rows[] = array( | |||||
$key, | |||||
idx($column, 'unique') ? pht('Yes') : pht('No'), | |||||
); | |||||
} | |||||
$table = id(new AphrontTableView($rows)) | |||||
->setHeaders( | |||||
array( | |||||
pht('Key'), | |||||
pht('Unique'), | |||||
)) | |||||
->setColumnClasses( | |||||
array( | |||||
'pri', | |||||
'wide', | |||||
)); | |||||
$content[] = id(new PHUIObjectBoxView()) | |||||
->setHeaderText(pht('Column Orders')) | |||||
->setTable($table); | |||||
} | |||||
$crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
$crumbs->addTextCrumb($method->getAPIMethodName()); | $crumbs->addTextCrumb($method->getAPIMethodName()); | ||||
return $this->buildApplicationPage( | return $this->buildApplicationPage( | ||||
array( | array( | ||||
$crumbs, | $crumbs, | ||||
$content, | $content, | ||||
), | ), | ||||
Show All 39 Lines |