new: [metafields] added view representation of info/warning/danger keys

cli-modification-summary
iglocska 2022-11-09 14:01:37 +01:00
parent d43e7c6c22
commit c44e1a8418
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 9 additions and 1 deletions

View File

@ -27,4 +27,9 @@ if (!empty($field['url'])) {
} else if (empty($field['raw'])) {
$string = h($string);
}
foreach (['info', 'warning', 'danger'] as $message_type) {
if (!empty($field[$message_type])) {
$string .= sprintf(' (<span class="text-%s">%s</span>)', $message_type, $field[$message_type]);
}
}
echo $string;

View File

@ -17,7 +17,10 @@ foreach($data['MetaTemplates'] as $metaTemplate) {
foreach ($metaTemplateField->metaFields as $metaField) {
$fields[] = [
'key' => !$labelPrintedOnce ? $metaField->field : '',
'raw' => $metaField->value
'raw' => $metaField->value,
'warning' => $metaField->warning ?? null,
'info' => $metaField->info ?? null,
'danger' => $metaField->danger ?? null
];
$labelPrintedOnce = true;
}