cvs: php4 /pear/HTML Table.php

From: Date: Wed, 16 Jan 2002 08:33:06 +0000
Subject: cvs: php4 /pear/HTML Table.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1971@lists.php.net to get a copy of this message
mansion Wed Jan 16 03:33:06 2002 EDT Modified files: /php4/pear/HTML Table.php Log: Changes by René Jensen : - Remove duplicate test - Nicer html output for nested table level comment. Index: php4/pear/HTML/Table.php diff -u php4/pear/HTML/Table.php:1.12 php4/pear/HTML/Table.php:1.13 --- php4/pear/HTML/Table.php:1.12 Tue Dec 11 10:31:27 2001 +++ php4/pear/HTML/Table.php Wed Jan 16 03:33:06 2002 @@ -17,7 +17,7 @@ // | Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: Table.php,v 1.12 2001/12/11 15:31:27 sebastian Exp $ +// $Id: Table.php,v 1.13 2002/01/16 08:33:06 mansion Exp $ require_once "PEAR.php"; require_once "HTML/Common.php"; @@ -491,21 +491,18 @@ } else { $attr = ""; } - if (isset($this->_structure[$i][$j]["attr"])) { - $attr = $this->_structure[$i][$j]["attr"]; - } else { - $attr = ""; - } if (isset($this->_structure[$i][$j]["contents"])) { $contents = $this->_structure[$i][$j]["contents"]; } else { $contents = ""; } + $flagCloseTable = false; $strHtml .= $tabs . "\t\t<$type" . $this->_getAttrString($attr) . ">"; if (is_object($contents)) { if (is_subclass_of($contents, "html_common")) { $contents->setTabOffset($this->_tabOffset + 3); $contents->_nestLevel = $this->_nestLevel + 1; + $flagCloseTable = true; } if (method_exists($contents, "toHtml")) { $contents = $contents->toHtml(); @@ -518,12 +515,13 @@ if (isset($this->_autoFill) && $contents == "") $contents = $this->_autoFill; $strHtml .= $contents; + $strHtml .= (isset($flagCloseTable)) ? "\t\t" : ''; $strHtml .= "</$type>\n"; } $strHtml .= $tabs ."\t</tr>\n"; } $strHtml .= - $tabs . "</table><!-- END TABLE LEVEL: $this->_nestLevel -->"; + $tabs . "</table>\n". $tabs . "<!-- END TABLE LEVEL: $this->_nestLevel -->\n"; return $strHtml; } // end func toHtml

« previous php.pear.cvs (#1971) next »