chg: [genericElement:index_table] Better support of array in generic fields

pull/93/head
Sami Mokaddem 2021-11-10 08:58:21 +01:00
parent 69f8375422
commit b6cf9e39dd
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 3 deletions

View File

@ -2,14 +2,16 @@
$data = $this->Hash->extract($row, $field['data_path']); $data = $this->Hash->extract($row, $field['data_path']);
if (is_array($data)) { if (is_array($data)) {
if (count($data) > 1) { if (count($data) > 1) {
$data = implode(', ', $data); $data = implode('</br> ', array_map('h', $data));
} else { } else {
if (count($data) > 0) { if (count($data) > 0) {
$data = $data[0]; $data = h($data[0]);
} else { } else {
$data = ''; $data = '';
} }
} }
} else {
$data = h($data);
} }
if (is_bool($data)) { if (is_bool($data)) {
$data = sprintf( $data = sprintf(
@ -17,7 +19,6 @@
$data ? 'check' : 'times' $data ? 'check' : 'times'
); );
} else { } else {
$data = h($data);
if (!empty($field['options'])) { if (!empty($field['options'])) {
$options = $this->Hash->extract($row, $field['options']); $options = $this->Hash->extract($row, $field['options']);
if (!empty($options)) { if (!empty($options)) {