Add BSFunctions::bool_to_string()
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 6 Jan 2009 06:44:53 +0000 (22:44 -0800)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 6 Jan 2009 06:44:53 +0000 (22:44 -0800)
* Functions.php:
(BSFunctions::bool_to_string): New function

CHANGES
Functions.php

diff --git a/CHANGES b/CHANGES
index 52301bbc3afe0958111ccd6d34cb3dae521bb6d8..ab36048b1482ae1f8a3aa7fc33bab74bd6a83fcb 100644 (file)
--- 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
index 8489a6cde4d8f79e1119b795eeb74b77247cbb07..bb4c2bfbc42770289638f0c005d20d1e45dc9ed0 100644 (file)
@@ -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