1
0

downgrade to kirby v3

This commit is contained in:
Philip Wagner
2024-09-01 10:47:15 +02:00
parent a4b2aece7b
commit af86acb7a1
1085 changed files with 54743 additions and 65042 deletions

View File

@@ -8,7 +8,7 @@ return [
],
'props' => [
/**
* Array or query string for reports. Each report needs a `label` and `value` and can have additional `info`, `link`, `icon` and `theme` settings.
* Array or query string for reports. Each report needs a `label` and `value` and can have additional `info`, `link` and `theme` settings.
*/
'reports' => function ($reports = null) {
if ($reports === null) {
@@ -34,9 +34,9 @@ return [
],
'computed' => [
'reports' => function () {
$reports = [];
$model = $this->model();
$toString = fn ($value) => $value === null ? null : $model->toString($value);
$reports = [];
$model = $this->model();
$value = fn ($value) => $value === null ? null : $model->toString($value);
foreach ($this->reports as $report) {
if (is_string($report) === true) {
@@ -47,18 +47,12 @@ return [
continue;
}
$info = $report['info'] ?? null;
$label = $report['label'] ?? null;
$link = $report['link'] ?? null;
$value = $report['value'] ?? null;
$reports[] = [
'icon' => $toString($report['icon'] ?? null),
'info' => $toString(I18n::translate($info, $info)),
'label' => $toString(I18n::translate($label, $label)),
'link' => $toString(I18n::translate($link, $link)),
'theme' => $toString($report['theme'] ?? null),
'value' => $toString(I18n::translate($value, $value))
'label' => I18n::translate($report['label'], $report['label']),
'value' => $value($report['value'] ?? null),
'info' => $value($report['info'] ?? null),
'link' => $value($report['link'] ?? null),
'theme' => $value($report['theme'] ?? null)
];
}