From 3af68ca9a9b6ab1f2de74d44e919b265bfe4285e Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 5 Nov 2024 18:21:31 -0800 Subject: [PATCH] Create getClassName(), update renderTemplate() --- includes/functions.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 19bc4eaa..ab8036a7 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -542,11 +542,15 @@ function ConvertToSecurity($security) /** * Renders a simple PHP template */ -function renderTemplate($name, $__template_data = []) +function renderTemplate($name, $__template_data = [], $pluginName = null) { - $file = realpath(dirname(__FILE__) . "/../templates/$name.php"); + if (isset($pluginName)) { + $file = realpath(dirname(__FILE__) . "/../plugins/$pluginName/templates/$name.php"); + } else { + $file = realpath(dirname(__FILE__) . "/../templates/$name.php"); + } if (!file_exists($file)) { - return "template $name ($file) not found"; + return "
template $name ($file) not found"; } if (is_array($__template_data)) { @@ -1029,3 +1033,10 @@ function renderStatus($hostapd_led, $hostapd_status, $memused_led, $memused, $cp