From 7cada33a5a5fc15a025455d34fe5fcb331229619 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 5 Jan 2009 22:44:53 -0800 Subject: [PATCH] Add BSFunctions::bool_to_string() * Functions.php: (BSFunctions::bool_to_string): New function --- CHANGES | 4 ++++ Functions.php | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index 52301bb..ab36048 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +3.2.1 +=================== +- New: BSFunctions::bool_to_string() to convert a boolean value into human-readable Yes/No + 3.2.0 =================== - New: Decorator.css.php and Decorator.js to be used to create HTML templates with standard formatting diff --git a/Functions.php b/Functions.php index 8489a6c..bb4c2bf 100644 --- a/Functions.php +++ b/Functions.php @@ -490,6 +490,17 @@ class BSFunctions { return substr($string, $start, $end - $start); } + + /** + * Converts a boolean value into the string 'Yes' or 'No' + * + * @param boolean + * @return string + */ + public static function bool_to_string($bool) + { + return ($bool ? _('Yes') : _('No')); + } } ?> \ No newline at end of file -- 2.43.5