💄 Don't show module in the plugin page
They're always active anyway
This commit is contained in:
parent
57d9043f0e
commit
aaaddc84d9
3 changed files with 8 additions and 3 deletions
|
@ -191,6 +191,10 @@ class Plugin
|
||||||
return $this->getMetadata('releaseDate');
|
return $this->getMetadata('releaseDate');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isModule() {
|
||||||
|
return $this->getMetadata('isModule');
|
||||||
|
}
|
||||||
|
|
||||||
public function className()
|
public function className()
|
||||||
{
|
{
|
||||||
return $this->className;
|
return $this->className;
|
||||||
|
|
|
@ -37,7 +37,7 @@ echo ' </h6><table class="table m-0">
|
||||||
// Show installed plugins
|
// Show installed plugins
|
||||||
foreach ($pluginsInstalled as $plugin) {
|
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
|
// Do not display theme's plugins
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,9 +77,9 @@ function buildPlugins($path, $autoActivate = false)
|
||||||
$Plugin = new $pluginClass;
|
$Plugin = new $pluginClass;
|
||||||
|
|
||||||
// Check if the plugin is translated
|
// 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)) {
|
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);
|
$database = file_get_contents($languageFilename);
|
||||||
|
@ -88,6 +88,7 @@ function buildPlugins($path, $autoActivate = false)
|
||||||
// Set name and description from the language file
|
// Set name and description from the language file
|
||||||
$Plugin->setMetadata('name',$database['plugin-data']['name']);
|
$Plugin->setMetadata('name',$database['plugin-data']['name']);
|
||||||
$Plugin->setMetadata('description',$database['plugin-data']['description']);
|
$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
|
// Remove name and description from the language file loaded and add new words if there are
|
||||||
// This function overwrite the key=>value
|
// This function overwrite the key=>value
|
||||||
|
|
Loading…
Add table
Reference in a new issue