diff --git a/actions/admin/settings/100.panel.php b/actions/admin/settings/100.panel.php index 81ce0050..aac246ec 100644 --- a/actions/admin/settings/100.panel.php +++ b/actions/admin/settings/100.panel.php @@ -37,9 +37,9 @@ return [ 'settinggroup' => 'panel', 'varname' => 'standardlanguage', 'type' => 'select', - 'default' => 'English', + 'default' => 'en', 'option_options_method' => [ - '\\Froxlor\\User', + '\\Froxlor\\Language', 'getLanguages' ], 'save_method' => 'storeSettingField' diff --git a/actions/admin/settings/180.dkim.php b/actions/admin/settings/180.dkim.php index 792ed8ff..23fbc7cc 100644 --- a/actions/admin/settings/180.dkim.php +++ b/actions/admin/settings/180.dkim.php @@ -108,7 +108,7 @@ return [ 'dkim_keylength' => [ 'label' => [ 'title' => lng('dkim.dkim_keylength.title'), - 'description' => sprintf(lng('dkim.dkim_keylength.description'), Settings::Get('dkim.dkim_prefix')) + 'description' => lng('dkim.dkim_keylength.description', [Settings::Get('dkim.dkim_prefix')]) ], 'settinggroup' => 'dkim', 'varname' => 'dkim_keylength', diff --git a/lib/Froxlor/Ajax/Ajax.php b/lib/Froxlor/Ajax/Ajax.php index 10fdc171..200e64d5 100644 --- a/lib/Froxlor/Ajax/Ajax.php +++ b/lib/Froxlor/Ajax/Ajax.php @@ -39,7 +39,6 @@ use Froxlor\UI\Panel\UI; use Froxlor\UI\Request; use Froxlor\UI\Response; use Froxlor\Validate\Validate; -use PDO; class Ajax { diff --git a/lib/Froxlor/Language.php b/lib/Froxlor/Language.php index 5af95b3e..77c68161 100644 --- a/lib/Froxlor/Language.php +++ b/lib/Froxlor/Language.php @@ -70,6 +70,13 @@ class Language } } + // shortcut for identifier with => [title, description] + if (!isset(self::$lng[$identifier]) && isset(self::$lng[$identifier . '.title'])) { + return [ + 'title' => vsprintf(self::$lng[$identifier . '.title'] ?? $identifier, $arguments), + 'description' => vsprintf(self::$lng[$identifier . '.description'] ?? $identifier, $arguments), + ]; + } // search by identifier return vsprintf(self::$lng[$identifier] ?? $identifier, $arguments); } diff --git a/lib/Froxlor/User.php b/lib/Froxlor/User.php index 4a770709..254e605e 100644 --- a/lib/Froxlor/User.php +++ b/lib/Froxlor/User.php @@ -84,20 +84,6 @@ class User return $returnval; } - public static function getLanguages() - { - $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_LANGUAGE . "` "); - $languages_array = []; - - while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { - if (!isset($languages_array[$row['language']]) && !in_array($row['language'], $languages_array)) { - $languages_array[$row['language']] = html_entity_decode($row['language']); - } - } - - return $languages_array; - } - /** * Function which updates all counters of used resources in panel_admins and panel_customers * diff --git a/lib/ajax.php b/lib/ajax.php index 67d5947c..5c7c73a2 100644 --- a/lib/ajax.php +++ b/lib/ajax.php @@ -35,6 +35,7 @@ if (!file_exists('./userdata.inc.php')) { die(); } require_once dirname(__DIR__) . '/lib/userdata.inc.php'; +require_once dirname(__DIR__) . '/lib/functions.php'; require_once dirname(__DIR__) . '/lib/tables.inc.php'; // Return response diff --git a/lng/de.lng.php b/lng/de.lng.php index 9642e7b7..9ee02658 100644 --- a/lng/de.lng.php +++ b/lng/de.lng.php @@ -1011,9 +1011,6 @@ Vielen Dank, Ihr Administrator', 'subject' => 'Froxlor - 2FA Code', ], ], - 'menu' => [ - 'message' => 'Nachrichten', - ], 'menue' => [ 'main' => [ 'main' => 'Allgemein', diff --git a/lng/en.lng.php b/lng/en.lng.php index c61cef6b..d8ef16d3 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -1308,9 +1308,6 @@ Yours sincerely, your administrator', 'subject' => 'Froxlor - 2FA Code', ], ], - 'menu' => [ - 'message' => 'Messages', - ], 'menue' => [ 'main' => [ 'main' => 'Main',