Update the comment formatting to not use the pound bar anymore and to put a space...
[isso.git] / PrinterElementTable.php
index 35c1d9b1958f149a6d8da176ebb36e6a5aef2f19..17e635b2f13c1f039e64b51dcd2a8276b0455e5a 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer Table Element (PrinterElementTable.php)
-*
-* @package     ISSO
-*/
+ * Printer Table Element (PrinterElementTable.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterRootTable.php');
 require_once(ISSO . '/PrinterElement.php');
 
 /**
-* Printer Table Element
-*
-* This represents a table row that holds elements.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Printer Table Element
+ *
+ * This represents a table row that holds elements.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 class BSPrinterElementTable extends BSPrinterAbstract
 {
        /**
-       * Array of child nodes
-       * @var array
-       */
+        * Array of child nodes
+        * @var array
+        */
        private $children = array();
        
        /**
-       * Number of columns to span
-       * @var integer
-       */
+        * Number of columns to span
+        * @var integer
+        */
        private $colspan = 0;
        
-       // ###################################################################
        /**
-       * Creates a table element; takes a variable number of arguments which
-       * are added as children in the order passed
-       *
-       * @param        BSPrinterElementTable...        Variable number (or no) children
-       */
+        * Creates a table element; takes a variable number of arguments which
+        * are added as children in the order passed
+        *
+        * @param       BSPrinterElementTable...        Variable number (or no) children
+        */
        public function __construct()
        {
                $childs = func_get_args();
@@ -80,15 +79,14 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $obj->newInstanceArgs($args);
        }
        
-       // ###################################################################
        /**
-       * Prints a simple row of text and text
-       *
-       * @param        string  Label (left side)
-       * @param        string  Value (right side)
-       *
-       * @return       BSPrinterElementTable   Table row element
-       */
+        * Prints a simple row of text and text
+        *
+        * @param       string  Label (left side)
+        * @param       string  Value (right side)
+        *
+        * @return      BSPrinterElementTable   Table row element
+        */
        public static function row_label($label, $value)
        {
                $tr = new BSPrinterElementTable();
@@ -99,17 +97,16 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Creates an input[text/password] field row
-       *
-       * @param        string  Label
-       * @param        string  Field name
-       * @param        mixed   Default value
-       * @param        bool    A password field?
-       *
-       * @return       BPrinterElementTable    Table row element
-       */
+        * Creates an input[text/password] field row
+        *
+        * @param       string  Label
+        * @param       string  Field name
+        * @param       mixed   Default value
+        * @param       bool    A password field?
+        *
+        * @return      BPrinterElementTable    Table row element
+        */
        public static function row_text($label, $name, $value = null, $password = false)
        {
                $tr = new BSPrinterElementTable();
@@ -120,16 +117,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Creates a submit row
-       *
-       * @param        array   Child elements to add before the buttons
-       * @param        string  Save button text
-       * @param        string  Reset button text
-       *
-       * @return       BSPrinterElementTable   Table row element
-       */
+        * Creates a submit row
+        *
+        * @param       array   Child elements to add before the buttons
+        * @param       string  Save button text
+        * @param       string  Reset button text
+        *
+        * @return      BSPrinterElementTable   Table row element
+        */
        public static function row_submit(Array $children = null, $save = ':submit:', $reset = ':reset:')
        {
                $build = '';
@@ -165,16 +161,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Constructs a <select> row from an array of BSPrinterElement's
-       *
-       * @param        string  Label
-       * @param        string  Name
-       * @param        array   Array of BSPrinterElement[option]'s
-       *
-       * @return       BSPrinterElementTable   Table row
-       */
+        * Constructs a <select> row from an array of BSPrinterElement's
+        *
+        * @param       string  Label
+        * @param       string  Name
+        * @param       array   Array of BSPrinterElement[option]'s
+        *
+        * @return      BSPrinterElementTable   Table row
+        */
        public static function row_list($label, $name, Array $options)
        {
                $build = '';
@@ -198,16 +193,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Constructs a row from an array of BSPrinterElement's of checkboxes
-       *
-       * @param        string  Label
-       * @param        string  Name
-       * @param        array   Array of BSPrinterElement[checkbox]'s that follow array(box label => BSPrinterElement)
-       *
-       * @return       BSPrinterElementTable   Table row
-       */
+        * Constructs a row from an array of BSPrinterElement's of checkboxes
+        *
+        * @param       string  Label
+        * @param       string  Name
+        * @param       array   Array of BSPrinterElement[checkbox]'s that follow array(box label => BSPrinterElement)
+        *
+        * @return      BSPrinterElementTable   Table row
+        */
        public static function row_checkbox($label, $name, Array $boxes)
        {
                $build = '';
@@ -235,16 +229,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Factory method to create an upload form element; requires that the
-       * form this is attached to have the upload flag set
-       *
-       * @param        string  Label for the element
-       * @param        string  Name of the <input>
-       *
-       * @return       BSPrinterElementTable   Upload form
-       */
+        * Factory method to create an upload form element; requires that the
+        * form this is attached to have the upload flag set
+        *
+        * @param       string  Label for the element
+        * @param       string  Name of the <input>
+        *
+        * @return      BSPrinterElementTable   Upload form
+        */
        public static function row_upload($label, $name)
        {
                $tr = new BSPrinterElementTable();
@@ -255,16 +248,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Creates a row with a radio select option for yes/no
-       *
-       * @param        string  Row label
-       * @param        string  Name of the radio buttons
-       * @param        bool    Yes is selected? (if false, No is selected)
-       *
-       * @return       BSPrinterElementTable   Yes-No row
-       */
+        * Creates a row with a radio select option for yes/no
+        *
+        * @param       string  Row label
+        * @param       string  Name of the radio buttons
+        * @param       bool    Yes is selected? (if false, No is selected)
+        *
+        * @return      BSPrinterElementTable   Yes-No row
+        */
        public static function row_yes_no($label, $name, $yes)
        {
                $elm = new BSPrinterElement('radio', $name, 1);
@@ -283,16 +275,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Prints a row with a textarea
-       *
-       * @param        string  Label
-       * @param        string  Textarea name
-       * @param        string  Value to fill with
-       *
-       * @return       BSPrinterElementTable   Table row
-       */
+        * Prints a row with a textarea
+        *
+        * @param       string  Label
+        * @param       string  Textarea name
+        * @param       string  Value to fill with
+        *
+        * @return      BSPrinterElementTable   Table row
+        */
        public static function row_textarea($label, $name, $value = null)
        {
                $tr = new BSPrinterElementTable();
@@ -303,40 +294,37 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Returns the number of columns in this element
-       *
-       * @return       integer Column count
-       */
+        * Returns the number of columns in this element
+        *
+        * @return      integer Column count
+        */
        public function numberOfColumns()
        {
                return sizeof($this->children);
        }
        
-       // ###################################################################
        /**
-       * Adds a child node to the element
-       *
-       * @param        BSPrinterAbstract       A child element
-       * 
-       * @return       fluent interface
-       */
+        * Adds a child node to the element
+        *
+        * @param       BSPrinterAbstract       A child element
+        
+        * @return      fluent interface
+        */
        public function addChild(BSPrinterAbstract $child)
        {
                $this->children[] = $child;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Sets the number of columns this row should have and pads the <td>
-       * elements accordingly
-       *
-       * @param        integer Column count
-       * 
-       * @return       fluent interface
-       */
+        * Sets the number of columns this row should have and pads the <td>
+        * elements accordingly
+        *
+        * @param       integer Column count
+        
+        * @return      fluent interface
+        */
        public function setColumnNumber($cols)
        {
                if ($cols < $this->numberOfColumns())
@@ -347,12 +335,11 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Returns the HTML for all printed children elements
-       *
-       * @return       string  Printed HTML
-       */
+        * Returns the HTML for all printed children elements
+        *
+        * @return      string  Printed HTML
+        */
        protected function _paintChildren()
        {
                $builder = '';
@@ -382,12 +369,11 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $builder;
        }
        
-       // ###################################################################
        /**
-       * Paints the entire table row
-       *
-       * @return       string  Table row HTML
-       */
+        * Paints the entire table row
+        *
+        * @return      string  Table row HTML
+        */
        public function paint()
        {
                return "\t<tr" . $this->_prepareStyle() . ">" . $this->_paintChildren() . "\n\t</tr>";