mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Check for plugin to handle request, fallback to core page actions
This commit is contained in:
parent
3af68ca9a9
commit
3a19ed9c3d
1 changed files with 26 additions and 7 deletions
|
@ -1,8 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
$extraFooterScripts = array();
|
|
||||||
$page = $_SERVER['PATH_INFO'];
|
$pluginManager = \RaspAP\Plugins\PluginManager::getInstance();
|
||||||
// handle page actions
|
|
||||||
switch ($page) {
|
// Get the requested page
|
||||||
|
$extraFooterScripts = array();
|
||||||
|
$page = $_SERVER['PATH_INFO'];
|
||||||
|
|
||||||
|
// Check if any plugin wants to handle the request
|
||||||
|
if (!$pluginManager->handlePageAction($page)) {
|
||||||
|
// If no plugin is available fall back to core page action handlers
|
||||||
|
handleCorePageAction($page, $extraFooterScripts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Core application page handling
|
||||||
|
*
|
||||||
|
* @param string $page
|
||||||
|
* @param array $extraFooterScripts
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function handleCorePageAction(string $page, array &$extraFooterScripts): void
|
||||||
|
{
|
||||||
|
switch ($page) {
|
||||||
case "/wlan0_info":
|
case "/wlan0_info":
|
||||||
DisplayDashboard($extraFooterScripts);
|
DisplayDashboard($extraFooterScripts);
|
||||||
break;
|
break;
|
||||||
|
@ -53,6 +72,6 @@
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DisplayDashboard($extraFooterScripts);
|
DisplayDashboard($extraFooterScripts);
|
||||||
}
|
}
|
||||||
?>
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue