diff options
Diffstat (limited to '')
| -rw-r--r-- | src/web/_views/header.php | 4 | ||||
| -rw-r--r-- | src/web/lib/hooks.php | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/web/_views/header.php b/src/web/_views/header.php index 5eb528a..fe8e0f1 100644 --- a/src/web/_views/header.php +++ b/src/web/_views/header.php @@ -7,7 +7,9 @@ <?=ie('<center>')?> <div class="center"> <div id="header" role="banner" aria-label="banner"> - <?=image('img/headerLogo', 'alt_website_logo', 'title_website_logo', size: '200')?> + <a href="<?=$this->get_url('')?>"> + <?=image('img/headerLogo', 'alt_website_logo', 'title_website_logo', size: '200')?> + </a> <div class="content"> <h1 class="logo-text"> <?=lang('first_name')?> diff --git a/src/web/lib/hooks.php b/src/web/lib/hooks.php index 70853e1..a688069 100644 --- a/src/web/lib/hooks.php +++ b/src/web/lib/hooks.php @@ -1,6 +1,20 @@ <?php /* Copyright (c) 2024 Freya Murphy */ +function load_htc(string $file) { + $file_path = PUBLIC_ROOT . '/polyfills/' . $file; + if (!file_exists($file_path)) + return; + + header('Content-type: text/x-component'); + include($file_path); + CRIMSON_DIE(); +} + function CRIMSON_pre_route_hook(Router $router): void { + $uri_str = ROUTER->req['uri_str'] ?? ''; + $file = basename($uri_str); + if (str_ends_with($file, '.htc')) + load_htc($file); } function CRIMSON_error_hook(?array $req, int $code): never { |