MDL-33814 Output renderers: table cell objects are only created when needed

This commit is contained in:
Frederic Massart
2012-07-03 11:36:47 +12:00
committed by Sam Hemelryk
parent f2fdb7f73a
commit 842a71a6ac
+4 -3
View File
@@ -1447,9 +1447,10 @@ class html_writer {
if (!($row instanceof html_table_row)) {
$newrow = new html_table_row();
foreach ($row as $item) {
$cell = new html_table_cell();
$cell->text = $item;
foreach ($row as $cell) {
if (!($cell instanceof html_table_cell)) {
$cell = new html_table_cell($cell);
}
$newrow->cells[] = $cell;
}
$row = $newrow;