julienmonnerie/kirby/config/fields/info.php

44 lines
770 B
PHP
Raw Normal View History

2022-06-17 17:51:59 +02:00
<?php
use Kirby\Toolkit\I18n;
return [
2022-08-31 15:02:43 +02:00
'props' => [
/**
* Unset inherited props
*/
'after' => null,
'autofocus' => null,
'before' => null,
'default' => null,
'disabled' => null,
'placeholder' => null,
'required' => null,
'translate' => null,
2022-06-17 17:51:59 +02:00
2022-08-31 15:02:43 +02:00
/**
* Text to be displayed
*/
'text' => function ($value = null) {
return I18n::translate($value, $value);
},
2022-06-17 17:51:59 +02:00
2022-08-31 15:02:43 +02:00
/**
* Change the design of the info box
*/
2025-04-21 18:57:21 +02:00
'theme' => function (string|null $theme = null) {
2022-08-31 15:02:43 +02:00
return $theme;
}
],
'computed' => [
'text' => function () {
if ($text = $this->text) {
$text = $this->model()->toSafeString($text);
$text = $this->kirby()->kirbytext($text);
return $text;
}
}
],
'save' => false,
2022-06-17 17:51:59 +02:00
];