From: Robert Sesek Date: Tue, 6 Jan 2009 06:44:53 +0000 (-0800) Subject: Add BSFunctions::bool_to_string() X-Git-Tag: 3.2.1~5 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=7cada33a5a5fc15a025455d34fe5fcb331229619;p=isso.git Add BSFunctions::bool_to_string() * Functions.php: (BSFunctions::bool_to_string): New function --- 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