Do not autoload sub-folders if autoload pages is disabled

This commit is contained in:
slawkens 2025-04-22 13:30:11 +02:00
parent b618084d50
commit d47195a787
2 changed files with 5 additions and 3 deletions

View File

@ -46,7 +46,7 @@
"settings": "plugins/your-plugin-folder/settings.php", "settings": "plugins/your-plugin-folder/settings.php",
"autoload": { "autoload": {
"pages": true, "pages": true,
"pagesSubFolders": false, "pages-sub-folders": false,
"commands": true, "commands": true,
"themes": true, "themes": true,
"admin-pages": true, "admin-pages": true,

View File

@ -151,7 +151,8 @@ class Plugins {
$pagesDefaultPriority = $plugin['pages-default-priority']; $pagesDefaultPriority = $plugin['pages-default-priority'];
} }
if (self::getAutoLoadOption($plugin, 'pages', true)) { $autoLoadPages = self::getAutoLoadOption($plugin, 'pages', true);
if ($autoLoadPages) {
// //
// Get all plugins/*/pages/*.php pages // Get all plugins/*/pages/*.php pages
// //
@ -164,7 +165,8 @@ class Plugins {
} }
} }
if (self::getAutoLoadOption($plugin, 'pagesSubFolders', true)) { if ($autoLoadPages && self::getAutoLoadOption($plugin, 'pagesSubFolders', true) &&
self::getAutoLoadOption($plugin, 'pages-sub-folders', true)) {
// //
// Get all plugins/*/pages/subFolder/*.php pages // Get all plugins/*/pages/subFolder/*.php pages
// //