Upgrade to 3.6.0
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Kirby\Exception\InvalidArgumentException;
|
||||
use Kirby\Toolkit\A;
|
||||
use Kirby\Toolkit\I18n;
|
||||
|
||||
return [
|
||||
@@ -20,19 +21,25 @@ return [
|
||||
* Sets the text next to the toggle. The text can be a string or an array of two options. The first one is the negative text and the second one the positive. The text will automatically switch when the toggle is triggered.
|
||||
*/
|
||||
'text' => function ($value = null) {
|
||||
$model = $this->model();
|
||||
|
||||
if (is_array($value) === true) {
|
||||
if (A::isAssociative($value) === true) {
|
||||
return I18n::translate($value, $value);
|
||||
return $model->toSafeString(I18n::translate($value, $value));
|
||||
}
|
||||
|
||||
foreach ($value as $key => $val) {
|
||||
$value[$key] = I18n::translate($val, $val);
|
||||
$value[$key] = $model->toSafeString(I18n::translate($val, $val));
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
return I18n::translate($value, $value);
|
||||
if (empty($value) === false) {
|
||||
return $model->toSafeString(I18n::translate($value, $value));
|
||||
}
|
||||
|
||||
return $value;
|
||||
},
|
||||
],
|
||||
'computed' => [
|
||||
|
Reference in New Issue
Block a user