Add MDCurrenciesSet for controlling currencies

This commit is contained in:
Joshua Ramon Enslin 2020-08-06 23:29:23 +02:00 committed by Stefan Rohde-Enslin
parent 5abbecfad7
commit 7f4c29eff9
3 changed files with 42 additions and 2 deletions

2
l18n

@ -1 +1 @@
Subproject commit 4b2c9ffee40ae15164b282177faabde441271821 Subproject commit 38c989b971471a0b69fe486cedf1d35587640ce8

39
src/MDCurrenciesSet.php Normal file
View File

@ -0,0 +1,39 @@
<?PHP
/**
* Contains a class for controlling the list of available currencies.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
/**
* Class containing available currencies.
*/
class MDCurrenciesSet extends MDValueSet {
const CURRENCIES = [
'',
"de-DM",
"de-RM",
"es-Real",
"eu-EUR",
"id-IDR",
"hu-Ft",
'hu-Lari',
'hu-Pengő',
"pl-Złoty",
"us-USD",
];
/**
* Gets a list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedList(MDTlLoader $tlLoader):array {
return parent::getTlSortedList($tlLoader, self::CURRENCIES, "currencies_set", "currencies_set");
}
}

View File

@ -24,7 +24,8 @@ class MDValueSet {
$output = []; $output = [];
foreach ($keyList as $tID) { foreach ($keyList as $tID) {
$output[$tID] = $tlLoader->tl($tlFileName, $tlVarName, $tID); if ($tID === "") $output[$tID] = "";
else $output[$tID] = $tlLoader->tl($tlFileName, $tlVarName, $tID);
} }
asort($output); asort($output);