cvs: php4 /pear/HTML Table.php
| From: | Bertrand Mansion | Date: | Thu, 31 Jan 2002 13:01:52 +0000 |
| Subject: | cvs: php4 /pear/HTML Table.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2257@lists.php.net to get a copy of this message | ||
mansion Thu Jan 31 08:01:52 2002 EDT
Modified files:
/php4/pear/HTML Table.php
Log:
Thanks to Arnaud Limbourg:
- phpDoc and cosmetic fixes
Index: php4/pear/HTML/Table.php diff -u php4/pear/HTML/Table.php:1.13 php4/pear/HTML/Table.php:1.14 --- php4/pear/HTML/Table.php:1.13 Wed Jan 16 03:33:06 2002 +++ php4/pear/HTML/Table.php Thu Jan 31 08:01:52 2002 @@ -17,71 +17,78 @@ // | Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: Table.php,v 1.13 2002/01/16 08:33:06 mansion Exp $ +// $Id: Table.php,v 1.14 2002/01/31 13:01:52 mansion Exp $ require_once "PEAR.php"; require_once "HTML/Common.php"; /** -* Builds an HTML table -* -* @author Adam Daniel <adaniel1@eesus.jnj.com> -* @author Bertrand Mansion <bmansion@mamasam.com> -* @version 1.6 -* @since PHP 4.0.3pl1 -*/ + * Builds an HTML table + * + * @author Adam Daniel <adaniel1@eesus.jnj.com> + * @author Bertrand Mansion <bmansion@mamasam.com> + * @version 1.6 + * @since PHP 4.0.3pl1 + */ class HTML_Table extends HTML_Common { /** * Automatically adds a new row or column if a given row or column index does not exist + * * @var bool - * @access private + * @access private */ var $_autoGrow = true; /** * Value to insert into empty cells + * * @var string - * @access private + * @access private */ var $_autoFill = " "; /** * Array containing the table structure - * @var array - * @access private + * + * @var array + * @access private */ var $_structure = array(); /** * Number of rows composing in the table - * @var int - * @access private + * + * @var int + * @access private */ var $_rows = 0; /** * Number of column composing the table - * @var int - * @access private + * + * @var int + * @access private */ var $_cols = 0; /** * Tracks the level of nested tables - * @var - * @since 1.5 - * @access private + * + * @var int + * @since 1.5 + * @access private */ var $_nestLevel = 0; /** * Class constructor + * * @param array $attributes Associative array of table tag attributes - * @param int $tabOffset - * @access public + * @param int $tabOffset + * @access public */ - function HTML_Table($attributes=null, $tabOffset=0) + function HTML_Table($attributes = null, $tabOffset = 0) { $commonVersion = 1.3; if (HTML_Common::apiVersion() < $commonVersion) { @@ -93,8 +100,9 @@ /** * Returns the API version + * * @access public - * @returns double + * @return double */ function apiVersion() { @@ -103,18 +111,20 @@ /** * Sets the table caption + * * @param string $caption - * @param mixed $attributes Associative array or string of table row attributes + * @param mixed $attributes Associative array or string of table row attributes * @access public */ - function setCaption($caption, $attributes=null) + function setCaption($caption, $attributes = null) { $attributes = $this->_parseAttributes($attributes); - $this->_structure["caption"] = array("attr"=>$attributes, "contents"=>$caption); + $this->_structure["caption"] = array("attr" => $attributes, "contents" => $caption); } // end func setCaption /** * Sets the autoFill value + * * @param mixed $fill * @access public */ @@ -125,8 +135,9 @@ /** * Returns the autoFill value + * * @access public - * @returns mixed + * @return mixed */ function getAutoFill() { @@ -135,6 +146,7 @@ /** * Sets the autoGrow value + * * @param bool $fill * @access public */ @@ -145,8 +157,9 @@ /** * Returns the autoGrow value + * * @access public - * @returns mixed + * @return mixed */ function getAutoGrow() { @@ -155,6 +168,7 @@ /** * Sets the number of rows in the table + * * @param int $rows * @access public */ @@ -165,6 +179,7 @@ /** * Sets the number of columns in the table + * * @param int $cols * @access public */ @@ -175,8 +190,9 @@ /** * Returns the number of rows in the table + * * @access public - * @returns int + * @return int */ function getRowCount() { @@ -185,8 +201,9 @@ /** * Sets the number of columns in the table + * * @access public - * @returns int + * @return int */ function getColCount() { @@ -195,6 +212,7 @@ /** * Sets a rows type 'TH' or 'TD' + * * @param int $row Row index * @param string $type 'TH' or 'TD' * @access public @@ -202,20 +220,21 @@ function setRowType($row, $type) { - for ($counter=0; $counter < $this->_cols; $counter++) { + for ($counter = 0; $counter < $this->_cols; $counter++) { $this->_structure[$row][$counter]["type"] = $type; } } // end func setRowType /** * Sets a columns type 'TH' or 'TD' + * * @param int $col Column index * @param string $type 'TH' or 'TD' * @access public */ function setColType($col, $type) { - for ($counter=0; $counter < $this->_rows; $counter++) { + for ($counter = 0; $counter < $this->_rows; $counter++) { $this->_structure[$counter][$col]["type"] = $type; } } // end func setColType @@ -226,9 +245,10 @@ * If the given indices do not exist and autoGrow is true then the given * row and/or col is automatically added. If autoGrow is false then an * error is returned. - * @param int $row Row index - * @param int $col Column index - * @param mixed $attributes Associative array or string of table row attributes + * + * @param int $row Row index + * @param int $col Column index + * @param mixed $attributes Associative array or string of table row attributes * @access public * @throws PEAR_Error */ @@ -246,9 +266,10 @@ /** * Updates the cell attributes passed but leaves other existing attributes in tact - * @param int $row Row index - * @param int $col Column index - * @param mixed $attributes Associative array or string of table row attributes + * + * @param int $row Row index + * @param int $col Column index + * @param mixed $attributes Associative array or string of table row attributes * @access public */ function updateCellAttributes($row, $col, $attributes) @@ -269,14 +290,15 @@ * If the given indices do not exist and autoGrow is true then the given * row and/or col is automatically added. If autoGrow is false then an * error is returned. - * @param int $row Row index - * @param int $col Column index - * @param mixed $contents May contain html or any object with a toHTML method - * @param string $type (optional) Cell type either 'TH' or 'TD' - * @access public + * + * @param int $row Row index + * @param int $col Column index + * @param mixed $contents May contain html or any object with a toHTML method + * @param string $type (optional) Cell type either 'TH' or 'TD' + * @access public * @throws PEAR_Error */ - function setCellContents($row, $col, $contents, $type='TD') + function setCellContents($row, $col, $contents, $type = 'TD') { if(isset($this->_structure[$row][$col]) && $this->_structure[$row][$col] == "__SPANNED__") return; $err = $this->_adjustEnds($row, $col, 'setCellContents'); @@ -289,9 +311,10 @@ /** * Returns the cell contents for an existing cell + * * @param int $row Row index * @param int $col Column index - * @access public + * @access public * @return mixed */ function getCellContents($row, $col) @@ -302,6 +325,7 @@ /** * Sets the contents of a header cell + * * @param int $row * @param int $col * @param mixed $contents @@ -314,19 +338,20 @@ /** * Adds a table row and returns the row identifier + * * @param array $contents (optional) Must be a indexed array of valid cell contents * @param mixed $attributes (optional) Associative array or string of table row attributes - * @param string $type (optional) Cell type either 'TH' or 'TD' - * @returns int - * @access public + * @param string $type (optional) Cell type either 'TH' or 'TD' + * @return int + * @access public */ - function addRow($contents=null, $attributes=null, $type='TD') + function addRow($contents = null, $attributes = null, $type = 'TD') { if (isset($contents) && !is_array($contents)) { return new PEAR_Error("First parameter to HTML_Table::addRow must be an array"); } $row = $this->_rows++; - for ($counter=0; $counter < count($contents); $counter++) { + for ($counter = 0; $counter < count($contents); $counter++) { if ($type == 'TD') { $this->setCellContents($row, $counter, $contents[$counter]); } elseif ($type == 'TH') { @@ -339,60 +364,64 @@ /** * Sets the row attributes for an existing row - * @param int $row Row index - * @param mixed $attributes Associative array or string of table row attributes - * @access public + * + * @param int $row Row index + * @param mixed $attributes Associative array or string of table row attributes + * @access public */ function setRowAttributes($row, $attributes) { for ($i = 0; $i < $this->_cols; $i++) { - $this->setCellAttributes($row,$i,$attributes); + $this->setCellAttributes($row, $i, $attributes); } } // end func setRowAttributes /** * Updates the row attributes for an existing row - * @param int $row Row index - * @param mixed $attributes Associative array or string of table row attributes - * @access public + * + * @param int $row Row index + * @param mixed $attributes Associative array or string of table row attributes + * @access public */ - function updateRowAttributes($row, $attributes=null) + function updateRowAttributes($row, $attributes = null) { for ($i = 0; $i < $this->_cols; $i++) { - $this->updateCellAttributes($row,$i,$attributes); + $this->updateCellAttributes($row, $i, $attributes); } } // end func updateRowAttributes /** * Alternates the row attributes starting at $start - * @param int $start Row index of row in which alternating begins + * + * @param int $start Row index of row in which alternating begins * @param mixed $attributes1 Associative array or string of table row attributes - * @param mixed $attribute2 Associative array or string of table row attributes - * @access public + * @param mixed $attribute2 Associative array or string of table row attributes + * @access public */ function altRowAttributes($start, $attributes1, $attributes2) { for ($row = $start ; $row < $this->_rows ; $row++) { - $attributes = (($row+$start)%2==0) ? $attributes1 : $attributes2; + $attributes = ( ($row+$start)%2 == 0 ) ? $attributes1 : $attributes2; $this->updateRowAttributes($row, $attributes); } } // end func altRowAttributes /** * Adds a table column and returns the column identifier + * * @param array $contents (optional) Must be a indexed array of valid cell contents * @param mixed $attributes (optional) Associative array or string of table row attributes - * @param string $type (optional) Cell type either 'TH' or 'TD' - * @returns int - * @access public + * @param string $type (optional) Cell type either 'TH' or 'TD' + * @return int + * @access public */ - function addCol($contents=null, $attributes=null, $type='TD') + function addCol($contents = null, $attributes = null, $type = 'TD') { if (isset($contents) && !is_array($contents)) { return new PEAR_Error("First parameter to HTML_Table::addCol must be an array"); } $col = $this->_cols++; - for ($counter=0; $counter < count($contents); $counter++) { + for ($counter = 0; $counter < count($contents); $counter++) { $this->setCellContents($counter, $col, $contents[$counter], $type); } $this->setColAttributes($col, $attributes); @@ -401,11 +430,12 @@ /** * Sets the column attributes for an existing column - * @param int $col Column index - * @param mixed $attributes (optional) Associative array or string of table row attributes - * @access public + * + * @param int $col Column index + * @param mixed $attributes (optional) Associative array or string of table row attributes + * @access public */ - function setColAttributes($col, $attributes=null) + function setColAttributes($col, $attributes = null) { for ($i = 0; $i < $this->_rows; $i++) { $this->setCellAttributes($i,$col,$attributes); @@ -414,24 +444,26 @@ /** * Updates the column attributes for an existing column - * @param int $col Column index - * @param mixed $attributes (optional) Associative array or string of table row attributes - * @access public + * + * @param int $col Column index + * @param mixed $attributes (optional) Associative array or string of table row attributes + * @access public */ - function updateColAttributes($col, $attributes=null) + function updateColAttributes($col, $attributes = null) { for ($i = 0; $i < $this->_rows; $i++) { - $this->updateCellAttributes($i,$col,$attributes); + $this->updateCellAttributes($i, $col, $attributes); } } // end func updateColAttributes /** * Sets the attributes for all cells + * * @param mixed $attributes (optional) Associative array or string of table row attributes * @since 1.6 * @access public */ - function setAllAttributes($attributes=null) + function setAllAttributes($attributes = null) { for ($i = 0; $i < $this->_rows; $i++) { $this->setRowAttributes($i, $attributes); @@ -440,11 +472,12 @@ /** * Updates the attributes for all cells + * * @param mixed $attributes (optional) Associative array or string of table row attributes * @since 1.6 * @access public */ - function updateAllAttributes($attributes=null) + function updateAllAttributes($attributes = null) { for ($i = 0; $i < $this->_rows; $i++) { $this->updateRowAttributes($i, $attributes); @@ -453,6 +486,7 @@ /** * Returns the table structure as HTML + * * @access public * @return string */ @@ -470,7 +504,7 @@ $attr = $this->_structure["caption"]["attr"]; $contents = $this->_structure["caption"]["contents"]; $strHtml .= $tabs . "\t<caption" . $this->_getAttrString($attr) . ">"; - if (is_array($contents)) $contents = implode(", ",$contents); + if (is_array($contents)) $contents = implode(", ", $contents); $strHtml .= $contents; $strHtml .= "</caption>\n"; } @@ -527,6 +561,7 @@ /** * Checks if rows or columns are spanned + * * @param int $row Row index * @param int $col Column index * @access private @@ -560,14 +595,15 @@ /** * Adjusts ends (total number of rows and columns) - * @param int $row Row index - * @param int $col Column index - * @param string $method Method name of caller - * Used to populate PEAR_Error if thrown. - * @param array $attributes Assoc array of attributes - * Default is an empty array. - * @access private - * @throws PEAR_Error + * + * @param int $row Row index + * @param int $col Column index + * @param string $method Method name of caller + * Used to populate PEAR_Error if thrown. + * @param array $attributes Assoc array of attributes + * Default is an empty array. + * @access private + * @throws PEAR_Error */ function _adjustEnds($row, $col, $method, $attributes = array()) { @@ -592,4 +628,4 @@ } } // end class HTML_Table -?> +?> \ No newline at end of file
Index: php4/pear/HTML/Table.php diff -u php4/pear/HTML/Table.php:1.13 php4/pear/HTML/Table.php:1.14 --- php4/pear/HTML/Table.php:1.13 Wed Jan 16 03:33:06 2002 +++ php4/pear/HTML/Table.php Thu Jan 31 08:01:52 2002 @@ -17,71 +17,78 @@ // | Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: Table.php,v 1.13 2002/01/16 08:33:06 mansion Exp $ +// $Id: Table.php,v 1.14 2002/01/31 13:01:52 mansion Exp $ require_once "PEAR.php"; require_once "HTML/Common.php"; /** -* Builds an HTML table -* -* @author Adam Daniel <adaniel1@eesus.jnj.com> -* @author Bertrand Mansion <bmansion@mamasam.com> -* @version 1.6 -* @since PHP 4.0.3pl1 -*/ + * Builds an HTML table + * + * @author Adam Daniel <adaniel1@eesus.jnj.com> + * @author Bertrand Mansion <bmansion@mamasam.com> + * @version 1.6 + * @since PHP 4.0.3pl1 + */ class HTML_Table extends HTML_Common { /** * Automatically adds a new row or column if a given row or column index does not exist + * * @var bool - * @access private + * @access private */ var $_autoGrow = true; /** * Value to insert into empty cells + * * @var string - * @access private + * @access private */ var $_autoFill = " "; /** * Array containing the table structure - * @var array - * @access private + * + * @var array + * @access private */ var $_structure = array(); /** * Number of rows composing in the table - * @var int - * @access private + * + * @var int + * @access private */ var $_rows = 0; /** * Number of column composing the table - * @var int - * @access private + * + * @var int + * @access private */ var $_cols = 0; /** * Tracks the level of nested tables - * @var - * @since 1.5 - * @access private + * + * @var int + * @since 1.5 + * @access private */ var $_nestLevel = 0; /** * Class constructor + * * @param array $attributes Associative array of table tag attributes - * @param int $tabOffset - * @access public + * @param int $tabOffset + * @access public */ - function HTML_Table($attributes=null, $tabOffset=0) + function HTML_Table($attributes = null, $tabOffset = 0) { $commonVersion = 1.3; if (HTML_Common::apiVersion() < $commonVersion) { @@ -93,8 +100,9 @@ /** * Returns the API version + * * @access public - * @returns double + * @return double */ function apiVersion() { @@ -103,18 +111,20 @@ /** * Sets the table caption + * * @param string $caption - * @param mixed $attributes Associative array or string of table row attributes + * @param mixed $attributes Associative array or string of table row attributes * @access public */ - function setCaption($caption, $attributes=null) + function setCaption($caption, $attributes = null) { $attributes = $this->_parseAttributes($attributes); - $this->_structure["caption"] = array("attr"=>$attributes, "contents"=>$caption); + $this->_structure["caption"] = array("attr" => $attributes, "contents" => $caption); } // end func setCaption /** * Sets the autoFill value + * * @param mixed $fill * @access public */ @@ -125,8 +135,9 @@ /** * Returns the autoFill value + * * @access public - * @returns mixed + * @return mixed */ function getAutoFill() { @@ -135,6 +146,7 @@ /** * Sets the autoGrow value + * * @param bool $fill * @access public */ @@ -145,8 +157,9 @@ /** * Returns the autoGrow value + * * @access public - * @returns mixed + * @return mixed */ function getAutoGrow() { @@ -155,6 +168,7 @@ /** * Sets the number of rows in the table + * * @param int $rows * @access public */ @@ -165,6 +179,7 @@ /** * Sets the number of columns in the table + * * @param int $cols * @access public */ @@ -175,8 +190,9 @@ /** * Returns the number of rows in the table + * * @access public - * @returns int + * @return int */ function getRowCount() { @@ -185,8 +201,9 @@ /** * Sets the number of columns in the table + * * @access public - * @returns int + * @return int */ function getColCount() { @@ -195,6 +212,7 @@ /** * Sets a rows type 'TH' or 'TD' + * * @param int $row Row index * @param string $type 'TH' or 'TD' * @access public @@ -202,20 +220,21 @@ function setRowType($row, $type) { - for ($counter=0; $counter < $this->_cols; $counter++) { + for ($counter = 0; $counter < $this->_cols; $counter++) { $this->_structure[$row][$counter]["type"] = $type; } } // end func setRowType /** * Sets a columns type 'TH' or 'TD' + * * @param int $col Column index * @param string $type 'TH' or 'TD' * @access public */ function setColType($col, $type) { - for ($counter=0; $counter < $this->_rows; $counter++) { + for ($counter = 0; $counter < $this->_rows; $counter++) { $this->_structure[$counter][$col]["type"] = $type; } } // end func setColType @@ -226,9 +245,10 @@ * If the given indices do not exist and autoGrow is true then the given * row and/or col is automatically added. If autoGrow is false then an * error is returned. - * @param int $row Row index - * @param int $col Column index - * @param mixed $attributes Associative array or string of table row attributes + * + * @param int $row Row index + * @param int $col Column index + * @param mixed $attributes Associative array or string of table row attributes * @access public * @throws PEAR_Error */ @@ -246,9 +266,10 @@ /** * Updates the cell attributes passed but leaves other existing attributes in tact - * @param int $row Row index - * @param int $col Column index - * @param mixed $attributes Associative array or string of table row attributes + * + * @param int $row Row index + * @param int $col Column index + * @param mixed $attributes Associative array or string of table row attributes * @access public */ function updateCellAttributes($row, $col, $attributes) @@ -269,14 +290,15 @@ * If the given indices do not exist and autoGrow is true then the given * row and/or col is automatically added. If autoGrow is false then an * error is returned. - * @param int $row Row index - * @param int $col Column index - * @param mixed $contents May contain html or any object with a toHTML method - * @param string $type (optional) Cell type either 'TH' or 'TD' - * @access public + * + * @param int $row Row index + * @param int $col Column index + * @param mixed $contents May contain html or any object with a toHTML method + * @param string $type (optional) Cell type either 'TH' or 'TD' + * @access public * @throws PEAR_Error */ - function setCellContents($row, $col, $contents, $type='TD') + function setCellContents($row, $col, $contents, $type = 'TD') { if(isset($this->_structure[$row][$col]) && $this->_structure[$row][$col] == "__SPANNED__") return; $err = $this->_adjustEnds($row, $col, 'setCellContents'); @@ -289,9 +311,10 @@ /** * Returns the cell contents for an existing cell + * * @param int $row Row index * @param int $col Column index - * @access public + * @access public * @return mixed */ function getCellContents($row, $col) @@ -302,6 +325,7 @@ /** * Sets the contents of a header cell + * * @param int $row * @param int $col * @param mixed $contents @@ -314,19 +338,20 @@ /** * Adds a table row and returns the row identifier + * * @param array $contents (optional) Must be a indexed array of valid cell contents * @param mixed $attributes (optional) Associative array or string of table row attributes - * @param string $type (optional) Cell type either 'TH' or 'TD' - * @returns int - * @access public + * @param string $type (optional) Cell type either 'TH' or 'TD' + * @return int + * @access public */ - function addRow($contents=null, $attributes=null, $type='TD') + function addRow($contents = null, $attributes = null, $type = 'TD') { if (isset($contents) && !is_array($contents)) { return new PEAR_Error("First parameter to HTML_Table::addRow must be an array"); } $row = $this->_rows++; - for ($counter=0; $counter < count($contents); $counter++) { + for ($counter = 0; $counter < count($contents); $counter++) { if ($type == 'TD') { $this->setCellContents($row, $counter, $contents[$counter]); } elseif ($type == 'TH') { @@ -339,60 +364,64 @@ /** * Sets the row attributes for an existing row - * @param int $row Row index - * @param mixed $attributes Associative array or string of table row attributes - * @access public + * + * @param int $row Row index + * @param mixed $attributes Associative array or string of table row attributes + * @access public */ function setRowAttributes($row, $attributes) { for ($i = 0; $i < $this->_cols; $i++) { - $this->setCellAttributes($row,$i,$attributes); + $this->setCellAttributes($row, $i, $attributes); } } // end func setRowAttributes /** * Updates the row attributes for an existing row - * @param int $row Row index - * @param mixed $attributes Associative array or string of table row attributes - * @access public + * + * @param int $row Row index + * @param mixed $attributes Associative array or string of table row attributes + * @access public */ - function updateRowAttributes($row, $attributes=null) + function updateRowAttributes($row, $attributes = null) { for ($i = 0; $i < $this->_cols; $i++) { - $this->updateCellAttributes($row,$i,$attributes); + $this->updateCellAttributes($row, $i, $attributes); } } // end func updateRowAttributes /** * Alternates the row attributes starting at $start - * @param int $start Row index of row in which alternating begins + * + * @param int $start Row index of row in which alternating begins * @param mixed $attributes1 Associative array or string of table row attributes - * @param mixed $attribute2 Associative array or string of table row attributes - * @access public + * @param mixed $attribute2 Associative array or string of table row attributes + * @access public */ function altRowAttributes($start, $attributes1, $attributes2) { for ($row = $start ; $row < $this->_rows ; $row++) { - $attributes = (($row+$start)%2==0) ? $attributes1 : $attributes2; + $attributes = ( ($row+$start)%2 == 0 ) ? $attributes1 : $attributes2; $this->updateRowAttributes($row, $attributes); } } // end func altRowAttributes /** * Adds a table column and returns the column identifier + * * @param array $contents (optional) Must be a indexed array of valid cell contents * @param mixed $attributes (optional) Associative array or string of table row attributes - * @param string $type (optional) Cell type either 'TH' or 'TD' - * @returns int - * @access public + * @param string $type (optional) Cell type either 'TH' or 'TD' + * @return int + * @access public */ - function addCol($contents=null, $attributes=null, $type='TD') + function addCol($contents = null, $attributes = null, $type = 'TD') { if (isset($contents) && !is_array($contents)) { return new PEAR_Error("First parameter to HTML_Table::addCol must be an array"); } $col = $this->_cols++; - for ($counter=0; $counter < count($contents); $counter++) { + for ($counter = 0; $counter < count($contents); $counter++) { $this->setCellContents($counter, $col, $contents[$counter], $type); } $this->setColAttributes($col, $attributes); @@ -401,11 +430,12 @@ /** * Sets the column attributes for an existing column - * @param int $col Column index - * @param mixed $attributes (optional) Associative array or string of table row attributes - * @access public + * + * @param int $col Column index + * @param mixed $attributes (optional) Associative array or string of table row attributes + * @access public */ - function setColAttributes($col, $attributes=null) + function setColAttributes($col, $attributes = null) { for ($i = 0; $i < $this->_rows; $i++) { $this->setCellAttributes($i,$col,$attributes); @@ -414,24 +444,26 @@ /** * Updates the column attributes for an existing column - * @param int $col Column index - * @param mixed $attributes (optional) Associative array or string of table row attributes - * @access public + * + * @param int $col Column index + * @param mixed $attributes (optional) Associative array or string of table row attributes + * @access public */ - function updateColAttributes($col, $attributes=null) + function updateColAttributes($col, $attributes = null) { for ($i = 0; $i < $this->_rows; $i++) { - $this->updateCellAttributes($i,$col,$attributes); + $this->updateCellAttributes($i, $col, $attributes); } } // end func updateColAttributes /** * Sets the attributes for all cells + * * @param mixed $attributes (optional) Associative array or string of table row attributes * @since 1.6 * @access public */ - function setAllAttributes($attributes=null) + function setAllAttributes($attributes = null) { for ($i = 0; $i < $this->_rows; $i++) { $this->setRowAttributes($i, $attributes); @@ -440,11 +472,12 @@ /** * Updates the attributes for all cells + * * @param mixed $attributes (optional) Associative array or string of table row attributes * @since 1.6 * @access public */ - function updateAllAttributes($attributes=null) + function updateAllAttributes($attributes = null) { for ($i = 0; $i < $this->_rows; $i++) { $this->updateRowAttributes($i, $attributes); @@ -453,6 +486,7 @@ /** * Returns the table structure as HTML + * * @access public * @return string */ @@ -470,7 +504,7 @@ $attr = $this->_structure["caption"]["attr"]; $contents = $this->_structure["caption"]["contents"]; $strHtml .= $tabs . "\t<caption" . $this->_getAttrString($attr) . ">"; - if (is_array($contents)) $contents = implode(", ",$contents); + if (is_array($contents)) $contents = implode(", ", $contents); $strHtml .= $contents; $strHtml .= "</caption>\n"; } @@ -527,6 +561,7 @@ /** * Checks if rows or columns are spanned + * * @param int $row Row index * @param int $col Column index * @access private @@ -560,14 +595,15 @@ /** * Adjusts ends (total number of rows and columns) - * @param int $row Row index - * @param int $col Column index - * @param string $method Method name of caller - * Used to populate PEAR_Error if thrown. - * @param array $attributes Assoc array of attributes - * Default is an empty array. - * @access private - * @throws PEAR_Error + * + * @param int $row Row index + * @param int $col Column index + * @param string $method Method name of caller + * Used to populate PEAR_Error if thrown. + * @param array $attributes Assoc array of attributes + * Default is an empty array. + * @access private + * @throws PEAR_Error */ function _adjustEnds($row, $col, $method, $attributes = array()) { @@ -592,4 +628,4 @@ } } // end class HTML_Table -?> +?> \ No newline at end of file