| 1 |
<?php |
<?php |
|
|
|
|
|
|
| 2 |
/** |
/** |
| 3 |
* |
* |
| 4 |
* $Id$ |
* $Id$ |
| 18 |
* with a title, column headers and data |
* with a title, column headers and data |
| 19 |
* |
* |
| 20 |
* @author Walter A. Boring IV |
* @author Walter A. Boring IV |
| 21 |
|
* @package phpHtmlLib |
| 22 |
*/ |
*/ |
| 23 |
class InfoTable extends BaseWidget { |
class InfoTable extends BaseWidget { |
| 24 |
|
|
| 97 |
//now go thru the rows of data |
//now go thru the rows of data |
| 98 |
//and add them |
//and add them |
| 99 |
foreach( $this->data as $row ) { |
foreach( $this->data as $row ) { |
| 100 |
$tr = new TRtag; |
if ((count($row) == 1) && is_object($row[0]) && (is_a($row[0], "TRtag") || |
| 101 |
$cnt = count( $row ); |
is_a($row[0], "TDtag"))) { |
| 102 |
foreach( $row as $index => $data ) { |
$table->add_row( $row[0] ); |
| 103 |
$td = $this->_build_td("", "", $index+1, $cnt ); |
} else { |
| 104 |
$td->add( $data ); |
$tr = new TRtag; |
| 105 |
$tr->add( $td ); |
$cnt = count( $row ); |
| 106 |
} |
foreach( $row as $index => $data ) { |
| 107 |
$table->add_row( $tr ); |
$td = $this->_build_td("", "", $index+1, $cnt ); |
| 108 |
|
$td->add( $data ); |
| 109 |
|
$tr->add( $td ); |
| 110 |
|
} |
| 111 |
|
$table->add_row( $tr ); |
| 112 |
|
} |
| 113 |
} |
} |
|
|
|
| 114 |
return $table->render($indent_level, $output_debug); |
return $table->render($indent_level, $output_debug); |
| 115 |
} |
} |
| 116 |
|
|