From e21e20cfd7ff669502714af704dd975d2069b61d Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 26 Jan 2004 09:48:00 +0000 Subject: [PATCH] Mod to print_table to allow dividers between rows (used on forum listing) --- lib/weblib.php | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 1fa7f65563..042be9ffaf 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1270,6 +1270,8 @@ function print_table($table) { // $table->cellpadding padding on each cell // $table->cellspacing spacing between cells + global $THEME; + if (isset($table->align)) { foreach ($table->align as $key => $aa) { if ($aa) { @@ -1314,9 +1316,13 @@ function print_table($table) { echo "cellpadding\" cellspacing=\"$table->cellspacing\" class=\"generaltable\">\n"; + $countcols = 0; + if (!empty($table->head)) { + $countcols = count($table->head);; echo ""; foreach ($table->head as $key => $heading) { + if (!isset($size[$key])) { $size[$key] = ""; } @@ -1331,17 +1337,21 @@ function print_table($table) { if (!empty($table->data)) { foreach ($table->data as $row) { echo ""; - foreach ($row as $key => $item) { - if (!isset($size[$key])) { - $size[$key] = ""; - } - if (!isset($align[$key])) { - $align[$key] = ""; - } - if (!isset($wrap[$key])) { - $wrap[$key] = ""; - } - echo ""; + if ($row == "hr" and $countcols) { + echo ""; + } else { /// it's a normal row of data + foreach ($row as $key => $item) { + if (!isset($size[$key])) { + $size[$key] = ""; + } + if (!isset($align[$key])) { + $align[$key] = ""; + } + if (!isset($wrap[$key])) { + $wrap[$key] = ""; + } + echo ""; + } } echo "\n"; } -- 2.39.5
$item
borders\">
$item