chg: [bootstrap helper] added warning/info/danger fields

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

View File

@ -811,7 +811,10 @@ class BoostrapListTable extends BootstrapGeneric
private function genCell($field = []) private function genCell($field = [])
{ {
if (isset($field['raw'])) { if (isset($field['raw'])) {
$cellContent = h($field['raw']); $cellContent = $field['raw'];
if (empty($field['no_escaping'])) {
$field['raw'] = h($field['raw']);
}
} else if (isset($field['formatter'])) { } else if (isset($field['formatter'])) {
$cellContent = $field['formatter']($this->getValueFromObject($field), $this->item); $cellContent = $field['formatter']($this->getValueFromObject($field), $this->item);
} else if (isset($field['type'])) { } else if (isset($field['type'])) {
@ -822,6 +825,11 @@ class BoostrapListTable extends BootstrapGeneric
} else { } else {
$cellContent = h($this->getValueFromObject($field)); $cellContent = h($this->getValueFromObject($field));
} }
foreach (['info', 'warning', 'danger'] as $message_type) {
if (!empty($field[$message_type])) {
$cellContent .= sprintf(' <span class="text-%s">%s</span>', $message_type, $field[$message_type]);
}
}
return $this->genNode('td', [ return $this->genNode('td', [
'class' => [ 'class' => [
'col-8 col-sm-10', 'col-8 col-sm-10',