mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Check for plugin to handle request, fallback to core page actions
This commit is contained in:
		| @@ -1,8 +1,27 @@ | ||||
|       <?php | ||||
|         $extraFooterScripts = array(); | ||||
|         $page = $_SERVER['PATH_INFO']; | ||||
|         // handle page actions | ||||
|         switch ($page) { | ||||
| <?php | ||||
|  | ||||
| $pluginManager = \RaspAP\Plugins\PluginManager::getInstance(); | ||||
|  | ||||
| // 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": | ||||
|             DisplayDashboard($extraFooterScripts); | ||||
|             break; | ||||
| @@ -53,6 +72,6 @@ | ||||
|             break; | ||||
|         default: | ||||
|             DisplayDashboard($extraFooterScripts); | ||||
|         } | ||||
|       ?> | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user