chg: [UI] updated the generic element index fields

- json should accept single values without embedding them in a list
- generic field should automatically cast a list to a comma separated string
pull/5296/head
iglocska 2019-10-10 11:56:45 +02:00
parent be509b3833
commit 9609ff1822
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,11 @@
<?php
echo h(Hash::extract($row, $field['data_path'])[0]);
$data = Hash::extract($row, $field['data_path']);
if (is_array($data)) {
if (count($data) > 1) {
$data = implode(', ', $data);
} else {
$data = $data[0];
}
}
echo h($data);
?>

View File

@ -1,5 +1,9 @@
<?php
$data = h(Hash::extract($row, $field['data_path']));
// I feed dirty for this...
if (is_array($data) && count($data) === 1 && isset($data[0])) {
$data = $data[0];
}
echo sprintf(
'<div class="json_container_%s"></div>',
h($k)