Upgrade to 3.6.0

This commit is contained in:
Bastian Allgeier
2021-11-16 14:53:37 +01:00
parent 7388fa4d24
commit 92b7a330fa
318 changed files with 20017 additions and 6878 deletions

View File

@@ -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' => [