Upgrade to 4.3.1
This commit is contained in:
@@ -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'),
|
||||
]
|
||||
|
Reference in New Issue
Block a user