mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
feat: Plugins pages: subSubFolders
This commit is contained in:
parent
813786c768
commit
a8d255c04b
@ -21,7 +21,6 @@ class Plugins {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$duplicates = [];
|
|
||||||
$routes = [];
|
$routes = [];
|
||||||
foreach(self::getAllPluginsJson() as $plugin) {
|
foreach(self::getAllPluginsJson() as $plugin) {
|
||||||
$routesDefaultPriority = 1000;
|
$routesDefaultPriority = 1000;
|
||||||
@ -86,10 +85,7 @@ class Plugins {
|
|||||||
$file = str_replace(PLUGINS, 'plugins/', $file);
|
$file = str_replace(PLUGINS, 'plugins/', $file);
|
||||||
$name = pathinfo($file, PATHINFO_FILENAME);
|
$name = pathinfo($file, PATHINFO_FILENAME);
|
||||||
|
|
||||||
if (!isset($duplicates[$name])) {
|
$routes[] = [['get', 'post'], $name, $file, $pagesDefaultPriority];
|
||||||
$routes[] = [['get', 'post'], $name, $file, $pagesDefaultPriority];
|
|
||||||
$duplicates[$name] = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,9 +102,19 @@ class Plugins {
|
|||||||
$file = str_replace(PLUGINS, 'plugins/', $file);
|
$file = str_replace(PLUGINS, 'plugins/', $file);
|
||||||
$name = $folderName . '/' . pathinfo($file, PATHINFO_FILENAME);
|
$name = $folderName . '/' . pathinfo($file, PATHINFO_FILENAME);
|
||||||
|
|
||||||
if (!isset($duplicates[$name])) {
|
$routes[] = [['get', 'post'], $name, $file, $pagesDefaultPriority];
|
||||||
$routes[] = [['get', 'post'], $name, $file, $pagesDefaultPriority];
|
}
|
||||||
$duplicates[$name] = true;
|
|
||||||
|
$subFolders = glob(PLUGINS . $plugin['filename'] . '/pages/' . $folderName . '/*', GLOB_ONLYDIR);
|
||||||
|
foreach ($subFolders as $subFolder) {
|
||||||
|
$subFolderName = pathinfo($subFolder, PATHINFO_FILENAME);
|
||||||
|
$subSubFiles = glob(PLUGINS . $plugin['filename'] . '/pages/' . $folderName . '/' . $subFolderName . '/*.php');
|
||||||
|
|
||||||
|
foreach ($subSubFiles as $subSubFile) {
|
||||||
|
$subSubFile = str_replace(PLUGINS, 'plugins/', $subSubFile);
|
||||||
|
$name = $folderName . '/' . $subFolderName . '/' . pathinfo($subSubFile, PATHINFO_FILENAME);
|
||||||
|
|
||||||
|
$routes[] = [['get', 'post'], $name, $subSubFile, $pagesDefaultPriority];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user