In BSPrinterElementTable::__construct(), we can now on-the-fly create Label elements...
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 11 Mar 2008 19:16:51 +0000 (15:16 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 11 Mar 2008 19:16:51 +0000 (15:16 -0400)
* CHANGES
* PrinterElementTable.php:
(BSPrinterElementTable::__construct): If the child is not an instance of BSPrinterAbstract, make it into a Label

CHANGES [new file with mode: 0644]
PrinterElementTable.php

diff --git a/CHANGES b/CHANGES
new file mode 100644 (file)
index 0000000..5e66e52
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,3 @@
+3.1.0
+===================
+- Change: BSPrinterElementTable:__construct() can now take straight strings and convert them into BSPrinterElementLabel's
\ No newline at end of file
index 17e635b2f13c1f039e64b51dcd2a8276b0455e5a..2fe58b0d5739ed2744848f66bc85c5a488b5cc25 100644 (file)
@@ -63,6 +63,13 @@ class BSPrinterElementTable extends BSPrinterAbstract
                $childs = func_get_args();
                if (is_array($childs))
                {
+                       foreach ($childs as $key => $value)
+                       {
+                               if (!($value instanceof BSPrinterAbstract))
+                               {
+                                       $childs[$key] = BSPrinterElementLabel::make($value);
+                               }
+                       }
                        $this->children = $childs;
                }
        }