From aaaddc84d9972e9da9db57b92b9290016ceed3f1 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 2 Jul 2025 21:32:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Don't=20show=20module=20in=20the?= =?UTF-8?q?=20plugin=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They're always active anyway --- bl-kernel/abstract/plugin.class.php | 4 ++++ bl-kernel/admin/views/plugins.php | 2 +- bl-kernel/boot/rules/60.plugins.php | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bl-kernel/abstract/plugin.class.php b/bl-kernel/abstract/plugin.class.php index e514748e..9d2a1c46 100644 --- a/bl-kernel/abstract/plugin.class.php +++ b/bl-kernel/abstract/plugin.class.php @@ -191,6 +191,10 @@ class Plugin return $this->getMetadata('releaseDate'); } + public function isModule() { + return $this->getMetadata('isModule'); + } + public function className() { return $this->className; diff --git a/bl-kernel/admin/views/plugins.php b/bl-kernel/admin/views/plugins.php index ec8a6cb9..ee659935 100644 --- a/bl-kernel/admin/views/plugins.php +++ b/bl-kernel/admin/views/plugins.php @@ -37,7 +37,7 @@ echo ' // Show installed plugins foreach ($pluginsInstalled as $plugin) { - if ($plugin->type() == 'theme' || $plugin->type() == 'widget') { + if ($plugin->type() == 'theme' || $plugin->type() == 'widget' || $plugin->isModule()) { // Do not display theme's plugins continue; } diff --git a/bl-kernel/boot/rules/60.plugins.php b/bl-kernel/boot/rules/60.plugins.php index 484bd7d0..87a80198 100644 --- a/bl-kernel/boot/rules/60.plugins.php +++ b/bl-kernel/boot/rules/60.plugins.php @@ -77,9 +77,9 @@ function buildPlugins($path, $autoActivate = false) $Plugin = new $pluginClass; // Check if the plugin is translated - $languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.$site->language().'.json'; + $languageFilename = $path.$Plugin->directoryName().DS.'languages'.DS.$site->language().'.json'; if (!Sanitize::pathFile($languageFilename)) { - $languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.DEFAULT_LANGUAGE_FILE; + $languageFilename = $path.$Plugin->directoryName().DS.'languages'.DS.DEFAULT_LANGUAGE_FILE; } $database = file_get_contents($languageFilename); @@ -88,6 +88,7 @@ function buildPlugins($path, $autoActivate = false) // Set name and description from the language file $Plugin->setMetadata('name',$database['plugin-data']['name']); $Plugin->setMetadata('description',$database['plugin-data']['description']); + $Plugin->setMetadata('isModule',$autoActivate); // Remove name and description from the language file loaded and add new words if there are // This function overwrite the key=>value