diff --git a/kernel/services/ModuleService.php b/kernel/services/ModuleService.php index dd2c7d4..6a8b01c 100644 --- a/kernel/services/ModuleService.php +++ b/kernel/services/ModuleService.php @@ -471,6 +471,23 @@ class ModuleService return false; } + public function isShopModule(string $slug): bool + { + if ($this->isServerAvailable()){ + $modules_info = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug'); + + $modules_info = json_decode($modules_info->getBody()->getContents(), true); + $mod_info = $this->getModuleInfoBySlug($slug); + foreach ($modules_info as $mod) { + if ($mod['slug'] === $mod_info['slug']) { + return true; + } + } + } + + return false; + } + public function getKernelModules(): array { $modules_info = []; diff --git a/kernel/views/module/index.php b/kernel/views/module/index.php index 6114995..52c6bcb 100644 --- a/kernel/views/module/index.php +++ b/kernel/views/module/index.php @@ -54,7 +54,7 @@ $table->addAction(function ($row, $url) use ($moduleService) { }); $table->addAction(function ($row, $url) use ($moduleService){ - if (!$moduleService->isKernelModule($row['slug'])){ + if ($moduleService->isShopModule($row['slug'])){ if (!$moduleService->isLastVersion($row['slug'])) { $url = "$url/update/?slug=". $row['slug'];