Adds theme-asset page in index

main
Yasen Pramatarov 2025-06-26 14:27:54 +03:00
parent aea05ce0e6
commit 91cabf56e7
3 changed files with 15 additions and 3 deletions

View File

@ -116,9 +116,11 @@ class Theme
return null;
}
// Use the router to generate the URL
// Generate URL that goes through index.php
global $app_root;
return "$app_root/app/helpers/theme-asset.php?theme=" . urlencode($themeId) . "&path=" . urlencode($assetPath);
// Remove any trailing slash from app_root to avoid double slashes
$baseUrl = rtrim($app_root, '/');
return "$baseUrl/?page=theme-asset&theme=" . urlencode($themeId) . "&path=" . urlencode($assetPath);
}

View File

@ -0,0 +1,10 @@
<?php
/**
* Theme Asset handler
*
* Serves theme assets through the main application router.
* This provides a secure way to serve theme files that are outside the web root.
*/
// Include the theme asset handler
require_once __DIR__ . '/../helpers/theme-asset.php';

View File

@ -145,7 +145,7 @@ $allowed_urls = [
'conferences','participants','components',
'graphs','latest','livejs','agents',
'profile','credentials','config','security',
'settings','theme',
'settings','theme','theme-asset',
'status',
'help','about',
'login','logout',