From 3a19ed9c3d5f052460471774b8f8a1ffb6f4cb18 Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 5 Nov 2024 18:24:41 -0800 Subject: [PATCH] Check for plugin to handle request, fallback to core page actions --- includes/page_actions.php | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/includes/page_actions.php b/includes/page_actions.php index de4a1cd0..2e406bf8 100755 --- a/includes/page_actions.php +++ b/includes/page_actions.php @@ -1,8 +1,27 @@ - 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); - } - ?> + } +}