cvs: pear /HTML_Table Table.php

From: Date: Tue, 26 Oct 2004 19:09:29 +0000
Subject: cvs: pear /HTML_Table Table.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-25254@lists.php.net to get a copy of this message
dufuz Tue Oct 26 15:09:29 2004 EDT Modified files: /pear/HTML_Table Table.php Log: formatting the code a little http://cvs.php.net/diff.php/pear/HTML_Table/Table.php?r1=1.19&r2=1.20&ty=u Index: pear/HTML_Table/Table.php diff -u pear/HTML_Table/Table.php:1.19 pear/HTML_Table/Table.php:1.20 --- pear/HTML_Table/Table.php:1.19 Tue Oct 26 14:46:40 2004 +++ pear/HTML_Table/Table.php Tue Oct 26 15:09:29 2004 @@ -17,7 +17,7 @@ // | Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: Table.php,v 1.19 2004/10/26 18:46:40 dufuz Exp $ +// $Id: Table.php,v 1.20 2004/10/26 19:09:29 dufuz Exp $ require_once 'PEAR.php'; require_once 'HTML/Common.php'; @@ -575,35 +575,34 @@ $attr = $this->_structure['caption']['attr']; $contents = $this->_structure['caption']['contents']; $strHtml .= $tabs . $tab . '<caption' . $this->_getAttrString($attr) . '>'; - if (is_array($contents)) $contents = implode(', ', $contents); + if (is_array($contents)) { + $contents = implode(', ', $contents); + } $strHtml .= $contents; $strHtml .= '</caption>' . $lnEnd; } for ($i = 0 ; $i < $this->_rows ; $i++) { + $attr = ''; if (isset($this->_structure[$i]['attr'])) { - $strHtml .= $tabs . $tab . '<tr'.$this->_getAttrString($this->_structure[$i]['attr']).'>' . $lnEnd; - } else { - $strHtml .= $tabs .$tab . '<tr>' . $lnEnd; + $attr = $this->_getAttrString($this->_structure[$i]['attr']); } + $strHtml .= $tabs .$tab . '<tr'.$attr.'>' . $lnEnd; for ($j = 0 ; $j < $this->_cols ; $j++) { + $attr = ''; + $contents = ''; + $type = 'td'; if (isset($this -> _structure[$i][$j]) && $this->_structure[$i][$j] == '__SPANNED__') { $strHtml .= $tabs . $tab . $tab .'<!-- span -->' . $lnEnd; continue; } if (isset($this->_structure[$i][$j]['type'])) { $type = (strtolower($this->_structure[$i][$j]['type']) == 'th' ? 'th' : 'td'); - } else { - $type = 'td'; } 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 = ''; } $strHtml .= $tabs . $tab . $tab . "<$type" . $this->_getAttrString($attr) . '>'; if (is_object($contents)) {

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