From d0db0db7bc6fd9b7ab04f76d360e6a42762e8097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 23 Mar 2022 17:18:43 +0800 Subject: [PATCH] * adjust for get langs api. --- api/v1/entries/langs.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/api/v1/entries/langs.php b/api/v1/entries/langs.php index a29ee1b0f8..2add7ff10e 100644 --- a/api/v1/entries/langs.php +++ b/api/v1/entries/langs.php @@ -33,12 +33,40 @@ class langsEntry extends entry { if($module == 'all') { + $loadedModule = array(); foreach(glob($this->app->getModuleRoot() . '*') as $modulePath) { if(!is_dir($modulePath)) continue; $moduleName = basename($modulePath); $this->app->loadLang($moduleName); + + $loadedModule[$moduleName] = $moduleName; + } + + foreach(glob($this->app->getExtensionRoot() . '*') as $extensionPath) + { + if(!is_dir($extensionPath)) continue; + + $edition = basename($extensionPath); + if($edition == 'lite') continue; + if($edition == 'biz' or $edition == 'max') + { + if($this->config->edition == 'open') continue; + if($this->config->edition != 'open' and $this->config->edition != $edition) continue; + } + + foreach(glob($extensionPath . '/*') as $modulePath) + { + if(!is_dir($modulePath)) continue; + + $moduleName = basename($modulePath); + if(isset($loadedModule[$moduleName])) continue; + + $this->app->loadLang($moduleName); + + $loadedModule[$moduleName] = $moduleName; + } } break; }