Upgrade to 4.3.1

This commit is contained in:
Lukas Bestle
2024-08-29 11:03:34 +02:00
parent e50c0341fc
commit a955c7822e
13 changed files with 78 additions and 60 deletions

View File

@@ -12,12 +12,17 @@ return [
return App::instance()->option('languages.variables', true) !== false;
},
'action' => function (string $code) {
$kirby = App::instance();
$language = Find::language($code);
$link = '/languages/' . $language->code();
$strings = [];
$foundation = App::instance()->defaultLanguage()->translations();
$foundation = $kirby->defaultLanguage()->translations();
$translations = $language->translations();
// TODO: update following line and adapt for update and delete options
// when new `languageVariables.*` permissions available
$canUpdate = $kirby->user()?->role()->permissions()->for('languages', 'update') === true;
ksort($foundation);
foreach ($foundation as $key => $value) {
@@ -26,13 +31,14 @@ return [
'value' => $translations[$key] ?? null,
'options' => [
[
'click' => 'update',
'icon' => 'edit',
'text' => I18n::translate('edit'),
'click' => 'update',
'disabled' => $canUpdate === false,
'icon' => 'edit',
'text' => I18n::translate('edit'),
],
[
'click' => 'delete',
'disabled' => $language->isDefault() === false,
'disabled' => $canUpdate === false || $language->isDefault() === false,
'icon' => 'trash',
'text' => I18n::translate('delete'),
]