summaryrefslogtreecommitdiffstats
path: root/lib/general.lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/general.lib.php')
-rw-r--r--lib/general.lib.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/general.lib.php b/lib/general.lib.php
index c3c1e061..654bc5ac 100644
--- a/lib/general.lib.php
+++ b/lib/general.lib.php
@@ -956,4 +956,25 @@ function translate_pattern_code($code) {
} // translate_pattern_code
+
+/**
+ * print_boolean
+ * This function takes a boolean value and then print out a friendly
+ * text message, usefull if you have a 0/1 that you need to turn into
+ * a "Off" "On"
+ */
+function print_boolean($value) {
+
+
+ if ($value) {
+ $string = '<span class="item_on">' . _('On') . '</span>';
+ }
+ else {
+ $string = '<span class="item_off">' . _('Off') . '</span>';
+ }
+
+ return $string;
+
+} // print_boolean
+
?>