💄 Don't show module in the plugin page

They're always active anyway
This commit is contained in:
Kazhnuz 2025-07-02 21:32:24 +02:00
parent 57d9043f0e
commit aaaddc84d9
3 changed files with 8 additions and 3 deletions

View file

@ -191,6 +191,10 @@ class Plugin
return $this->getMetadata('releaseDate');
}
public function isModule() {
return $this->getMetadata('isModule');
}
public function className()
{
return $this->className;

View file

@ -37,7 +37,7 @@ echo ' </h6><table class="table m-0">
// 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;
}

View file

@ -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