mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 22:38:42 +00:00
fix invalid class loading
This commit is contained in:
parent
8fc34ef870
commit
aaa8d9d533
|
|
@ -16,6 +16,7 @@ namespace phpOMS\Localization;
|
||||||
|
|
||||||
use phpOMS\Log\FileLogger;
|
use phpOMS\Log\FileLogger;
|
||||||
use phpOMS\Module\ModuleAbstract;
|
use phpOMS\Module\ModuleAbstract;
|
||||||
|
use phpOMS\Autoloader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Localization class.
|
* Localization class.
|
||||||
|
|
@ -162,6 +163,10 @@ final class L11nManager
|
||||||
try {
|
try {
|
||||||
/** @var ModuleAbstract $class */
|
/** @var ModuleAbstract $class */
|
||||||
$class = '\Modules\\' . $module . '\\Controller\\' . ($app ?? $this->appName) . 'Controller';
|
$class = '\Modules\\' . $module . '\\Controller\\' . ($app ?? $this->appName) . 'Controller';
|
||||||
|
if (!Autoloader::exists($class)) {
|
||||||
|
return 'ERROR';
|
||||||
|
}
|
||||||
|
|
||||||
$this->loadLanguage($code, $module, $class::getLocalization($code, $theme));
|
$this->loadLanguage($code, $module, $class::getLocalization($code, $theme));
|
||||||
|
|
||||||
if (!isset($this->language[$code][$module][$translation])) {
|
if (!isset($this->language[$code][$module][$translation])) {
|
||||||
|
|
@ -257,15 +262,21 @@ final class L11nManager
|
||||||
$language = $l11n->getLanguage() ?? 'en';
|
$language = $l11n->getLanguage() ?? 'en';
|
||||||
$symbol ??= $l11n->getCurrency();
|
$symbol ??= $l11n->getCurrency();
|
||||||
|
|
||||||
if ($divide === 1000) {
|
if (\is_float($currency)) {
|
||||||
$symbol = $this->getHtml($language, '0', '0', 'CurrencyK') . $symbol;
|
$currency = (int) ($currency * \pow(10, Money::MAX_DECIMALS));
|
||||||
} elseif ($divide === 1000000) {
|
|
||||||
$symbol = $this->getHtml($language, '0', '0', 'CurrencyM') . $symbol;
|
|
||||||
} elseif ($divide === 1000000000) {
|
|
||||||
$symbol = $this->getHtml($language, '0', '0', 'CurrencyB') . $symbol;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$money = new Money($currency / $divide, $l11n->getThousands(), $l11n->getDecimal(), $symbol ?? $l11n->getCurrency(), (int) $l11n->getCurrencyFormat());
|
if (!empty($symbol)) {
|
||||||
|
if ($divide === 1000) {
|
||||||
|
$symbol = $this->getHtml($language, '0', '0', 'CurrencyK') . $symbol;
|
||||||
|
} elseif ($divide === 1000000) {
|
||||||
|
$symbol = $this->getHtml($language, '0', '0', 'CurrencyM') . $symbol;
|
||||||
|
} elseif ($divide === 1000000000) {
|
||||||
|
$symbol = $this->getHtml($language, '0', '0', 'CurrencyB') . $symbol;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$money = new Money((int) ($currency / $divide), $l11n->getThousands(), $l11n->getDecimal(), $symbol ?? $l11n->getCurrency(), (int) $l11n->getCurrencyFormat());
|
||||||
|
|
||||||
return $money->getCurrency($l11n->getPrecision()[$format ?? 'medium']);
|
return $money->getCurrency($l11n->getPrecision()[$format ?? 'medium']);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user