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,
|
|
|
|
'icon' => 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
|
|
|
|
*/
|
|
|
|
'theme' => function (string $theme = null) {
|
|
|
|
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
|
|
|
];
|