From c594dfd14b57e97c75b7b138aa17770612892544 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 25 Jan 2024 22:29:19 +0100 Subject: [PATCH] Feature: auto-load pages in plugins/*/pages/*.php --- system/libs/plugins.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system/libs/plugins.php b/system/libs/plugins.php index 2446d418..d6226168 100644 --- a/system/libs/plugins.php +++ b/system/libs/plugins.php @@ -57,6 +57,15 @@ class Plugins { } $routes = []; + + $pluginPages = glob(PLUGINS . '*/pages/*.php'); + foreach ($pluginPages as $file) { + $file = str_replace(PLUGINS, 'plugins/', $file); + $name = pathinfo($file, PATHINFO_FILENAME); + + $routes[] = [['get', 'post'], $name, $file, 1000]; + } + foreach(self::getAllPluginsJson() as $plugin) { $warningPreTitle = 'Plugin: ' . $plugin['name'] . ' - ';