Differential D14073 Diff 34742 src/applications/harbormaster/controller/HarbormasterStepEditController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/controller/HarbormasterStepEditController.php
| Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Lines | private function renderBuildVariablesTable() { | ||||
| $variables = HarbormasterBuild::getAvailableBuildVariables(); | $variables = HarbormasterBuild::getAvailableBuildVariables(); | ||||
| ksort($variables); | ksort($variables); | ||||
| $rows = array(); | $rows = array(); | ||||
| $rows[] = pht( | $rows[] = pht( | ||||
| 'The following variables can be used in most fields. '. | 'The following variables can be used in most fields. '. | ||||
| 'To reference a variable, use `%s` in a field.', | 'To reference a variable, use `%s` in a field.', | ||||
| '${name}'); | '${name}'); | ||||
| $rows[] = pht('| Variable | Description |'); | $rows[] = sprintf( | ||||
| '| %s | %s |', | |||||
| pht('Variable'), | |||||
| pht('Description')); | |||||
| $rows[] = '|---|---|'; | $rows[] = '|---|---|'; | ||||
| foreach ($variables as $name => $description) { | foreach ($variables as $name => $description) { | ||||
| $rows[] = '| `'.$name.'` | '.$description.' |'; | $rows[] = '| `'.$name.'` | '.$description.' |'; | ||||
| } | } | ||||
| $rows = implode("\n", $rows); | $rows = implode("\n", $rows); | ||||
| $form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->appendRemarkupInstructions($rows); | ->appendRemarkupInstructions($rows); | ||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Build Variables')) | ->setHeaderText(pht('Build Variables')) | ||||
| ->appendChild($form); | ->appendChild($form); | ||||
| } | } | ||||
| } | } | ||||