From 8a2c577823b69117af8eda9b1a46bfbcae8153c6 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 8 Jul 2024 17:22:30 -0400 Subject: a few fixes, just a few.... --- src/web/helpers/lang.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'src/web/helpers/lang.php') diff --git a/src/web/helpers/lang.php b/src/web/helpers/lang.php index e8fa29e..b11cc7c 100644 --- a/src/web/helpers/lang.php +++ b/src/web/helpers/lang.php @@ -1,7 +1,13 @@ $sub + */ +function lang( + string $key, + ?string $default = NULL, + ?array $sub = NULL) { $lang = $GLOBALS['lang']; if(array_key_exists($key, $lang)) { if ($sub) { @@ -17,15 +23,20 @@ function lang($key, $default = NULL, $sub = NULL) { } } -function ilang($key, - $class = NULL, - $id = NULL, - $href = NULL, - $click = NULL, - $attrs = array(), - $sub = NULL, - $button = FALSE, - $container = 'span' +/** + * @param array $attrs + * @param ?array $sub + */ +function ilang( + string $key, + string $class = NULL, + string $id = NULL, + string $href = NULL, + string $click = NULL, + array $attrs = array(), + ?array $sub = NULL, + bool $button = FALSE, + string $container = 'span' ) { $text = ucfirst(lang($key . "_text", FALSE, sub: $sub)); $tip = lang($key . "_tip", FALSE, sub: $sub); -- cgit v1.2.3-freya