From 5bd4280e83e87ac4218aadde030c7d0420c56fd9 Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 13 Oct 2023 17:49:13 +0200 Subject: [PATCH] Prepare for automatic style sheet loading per page This feature will be used in future development of the GUI It allows pages to have their own style sheet settings stored in a related .css file --- emhttp/plugins/dynamix/include/DefaultPageLayout.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout.php b/emhttp/plugins/dynamix/include/DefaultPageLayout.php index fe0277879..e983ad8ca 100644 --- a/emhttp/plugins/dynamix/include/DefaultPageLayout.php +++ b/emhttp/plugins/dynamix/include/DefaultPageLayout.php @@ -738,6 +738,10 @@ foreach ($pages as $page) { // create list of nchan scripts to be started if (isset($page['Nchan'])) nchan_merge($page['root'], $page['Nchan']); annotate($page['file']); + // include page specific stylesheet (if existing) + $css = "/{$page['root']}/styles/".strtolower($page['name']).".css"; + if (is_file($docroot.$css)) echo '',"\n"; + // create page content empty($page['Markdown']) || $page['Markdown']=='true' ? eval('?>'.Markdown(parse_text($page['text']))) : eval('?>'.parse_text($page['text'])); if ($close) echo ""; }