Files
udo cd1af21ba6 Refactor theme rendering and gauge components
- Consolidated theme rendering logic into helper functions in `lib/theme_helpers.php`.
- Updated `page.html.php` for both dark and light themes to utilize new rendering functions.
- Introduced `arcgauge` component for SVG arc gauges with dynamic updates.
- Enhanced CSS for gauges to improve layout and styling consistency.
- Added new test suite for smoke testing routes and component rendering.
- Updated index and themes views to dynamically display theme information from configuration.
2026-04-18 13:54:33 +00:00

41 lines
1.1 KiB
PHP
Executable File

<?php
include('config/settings.php');
include('lib/ulib.php');
include('lib/components.php');
include('lib/theme_helpers.php');
URL::MakeRoute();
Profiler::log('main content: start', 1);
ob_start();
$route_match = URL::ResolveViewFile('views');
if($route_match)
{
if(isset($route_match['param']))
URL::$route['param'] = $route_match['param'];
require($route_match['file']);
}
else
{
URL::NotFound('The requested page does not exist.');
URL::$route['page-title'] = '404 Not Found';
echo '<section class="card">';
echo '<h1>404 Not Found</h1>';
echo '<p>'.safe(URL::$error).'</p>';
echo '</section>';
}
URL::$fragments['main'] = ob_get_clean();
Profiler::log('main content: end', -1);
$page_template = cfg('theme/path').'/page.'.URL::$page_type.'.php';
if(!file_exists($page_template))
$page_template = 'themes/common/page.'.URL::$page_type.'.php';
if(!file_exists($page_template))
die('fatal error: page template not found ('.$page_template.')');
require($page_template);
Log::audit('page:'.URL::$route['page'], URL::$route['l-path']);