Add JSON API for getting list of available fields
This commit is contained in:
parent
b6b882f059
commit
e423668d93
|
@ -27,8 +27,19 @@ else if (!isset($_SESSION['lang'])) {
|
||||||
}
|
}
|
||||||
$lang = $_SESSION['lang'];
|
$lang = $_SESSION['lang'];
|
||||||
|
|
||||||
|
$outFormat = MD_STD_IN::get_http_input_text("output", "html", ['html', 'json']);
|
||||||
|
|
||||||
$tlLoader = new MDTlLoader("csxml_start", $lang);
|
$tlLoader = new MDTlLoader("csxml_start", $lang);
|
||||||
|
|
||||||
|
$fieldsGetter = new CsvxmlAvailableFields($lang);
|
||||||
|
$availableFields = $fieldsGetter->getFields();
|
||||||
|
|
||||||
|
if ($outFormat === 'json') {
|
||||||
|
header('content-type: application/json');
|
||||||
|
echo json_encode($availableFields);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$toInject = '
|
$toInject = '
|
||||||
<script src="assets/js/newToolTip.js" type="text/javascript" defer></script>
|
<script src="assets/js/newToolTip.js" type="text/javascript" defer></script>
|
||||||
';
|
';
|
||||||
|
@ -57,9 +68,6 @@ echo '
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
$fieldsGetter = new CsvxmlAvailableFields($lang);
|
|
||||||
$availableFields = $fieldsGetter->getFields();
|
|
||||||
|
|
||||||
$tooltips = [];
|
$tooltips = [];
|
||||||
foreach ($availableFields as $headline => $fields) {
|
foreach ($availableFields as $headline => $fields) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user