Fix: show all plugins in content-edit, not just those with plugin.json
HTMLBlock has no plugin.json, only HTMLBlock.php. Accept plugin if it has plugin.json OR <PluginName>.php.
This commit is contained in:
+6
-2
@@ -508,17 +508,21 @@ function handleContentEdit($auth, $config, $twig, $user, $csrf, $siteConfig): vo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get available plugins
|
// Get available plugins (must have plugin.json or <PluginName>.php)
|
||||||
$pluginsDir = $config['plugins_dir'];
|
$pluginsDir = $config['plugins_dir'];
|
||||||
$availablePlugins = [];
|
$availablePlugins = [];
|
||||||
if (is_dir($pluginsDir)) {
|
if (is_dir($pluginsDir)) {
|
||||||
foreach (glob($pluginsDir . '*', GLOB_ONLYDIR) as $pluginDir) {
|
foreach (glob($pluginsDir . '*', GLOB_ONLYDIR) as $pluginDir) {
|
||||||
$pluginName = basename($pluginDir);
|
$pluginName = basename($pluginDir);
|
||||||
if ($pluginName !== '.' && $pluginName !== '..' && file_exists($pluginDir . '/plugin.json')) {
|
if ($pluginName !== '.' && $pluginName !== '..') {
|
||||||
|
$hasJson = file_exists($pluginDir . '/plugin.json');
|
||||||
|
$hasPhp = file_exists($pluginDir . '/' . $pluginName . '.php');
|
||||||
|
if ($hasJson || $hasPhp) {
|
||||||
$availablePlugins[] = $pluginName;
|
$availablePlugins[] = $pluginName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$currentLang = extractLanguagePrefix($file);
|
$currentLang = extractLanguagePrefix($file);
|
||||||
$route = 'content-edit';
|
$route = 'content-edit';
|
||||||
|
|||||||
Reference in New Issue
Block a user