diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-02-23 22:57:27 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-02-23 22:57:27 -0500 |
| commit | f373ead95fb5beb962c376b5b7b46dfde8ac4e57 (patch) | |
| tree | c99df23521ff2a5e5e2e4627c525a5e99dc2e3ae /src/web/lib | |
| parent | add 96x96 logo (diff) | |
| download | website-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.tar.gz website-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.tar.bz2 website-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.zip | |
update website to work with crimson framework
Diffstat (limited to '')
| -rw-r--r-- | src/web/lib/aria.php (renamed from src/web/helpers/aria.php) | 0 | ||||
| -rw-r--r-- | src/web/lib/hooks.php | 10 | ||||
| -rw-r--r-- | src/web/lib/ie.php (renamed from src/web/helpers/ie.php) | 0 | ||||
| -rw-r--r-- | src/web/lib/image.php (renamed from src/web/helpers/image.php) | 6 | ||||
| -rw-r--r-- | src/web/lib/markdown.php (renamed from src/web/helpers/markdown.php) | 0 |
5 files changed, 14 insertions, 2 deletions
diff --git a/src/web/helpers/aria.php b/src/web/lib/aria.php index 0e06b97..0e06b97 100644 --- a/src/web/helpers/aria.php +++ b/src/web/lib/aria.php diff --git a/src/web/lib/hooks.php b/src/web/lib/hooks.php new file mode 100644 index 0000000..70853e1 --- /dev/null +++ b/src/web/lib/hooks.php @@ -0,0 +1,10 @@ +<?php /* Copyright (c) 2024 Freya Murphy */ + +function CRIMSON_pre_route_hook(Router $router): void { +} + +function CRIMSON_error_hook(?array $req, int $code): never { + $error_controller = ROUTER->load_controller('error'); + $error_controller->code($code); + CRIMSON_DIE(); +} diff --git a/src/web/helpers/ie.php b/src/web/lib/ie.php index ead6c1a..ead6c1a 100644 --- a/src/web/helpers/ie.php +++ b/src/web/lib/ie.php diff --git a/src/web/helpers/image.php b/src/web/lib/image.php index d4683fe..7b6ec0e 100644 --- a/src/web/helpers/image.php +++ b/src/web/lib/image.php @@ -1,5 +1,7 @@ <?php /* Copyright (c) 2024 Freya Murphy */ + + function __get_mime($type) { switch ($type) { @@ -30,7 +32,7 @@ function __make_source( } else { $media = ''; } - $path = Core::get_url('public/' . $name . '.' . $format, TRUE); + $path = Base::get_url('public/' . $name . '.' . $format, TRUE); $mime = __get_mime($format); return sprintf('<source type="%s" srcset="%s" %s>', $mime, $path, $media); @@ -68,7 +70,7 @@ function image( } $format = end($formats); - $path = Core::get_url('public/' . $name . '.' . $format, TRUE); + $path = Base::get_url('public/' . $name . '.' . $format, TRUE); $out .= "<img src=\"$path\""; if ($alt) { $alt = lang($alt); diff --git a/src/web/helpers/markdown.php b/src/web/lib/markdown.php index 5279a1f..5279a1f 100644 --- a/src/web/helpers/markdown.php +++ b/src/web/lib/markdown.php |