From 0064f98651c627387115e84e7632f9eceff5d4c3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 17 Oct 2019 15:55:05 +0200 Subject: [serversetup-bwlp-ipxe] UI/UX tweaks * Decluttered bootentry View in menu editor * Show details for hook bootentry in menu editor * Buttons for "save and reload" in menu/bootentry editor --- inc/util.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'inc/util.inc.php') diff --git a/inc/util.inc.php b/inc/util.inc.php index 06cd8981..3d912f80 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -512,6 +512,18 @@ SADFACE; return date('d.m.Y', $ts); } + /** + * Return localized strings for yes or no depending on $bool + * @param bool $bool Input to evaluate + * @return string Yes or No, in user's selected language + */ + public static function boolToString($bool) + { + if ($bool) + return Dictionary::translate('lang_yes', true); + return Dictionary::translate('lang_no', true); + } + /** * Format a duration, in seconds, into a readable string. * @param int $seconds The number to format -- cgit v1.2.3-55-g7522