From: moodler Date: Tue, 23 Sep 2003 12:18:27 +0000 (+0000) Subject: Small fix to avoid warnings on empty tables X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a1f8ff87c779e5e6bc703b4d2f2c113d7aaf05de;p=moodle.git Small fix to avoid warnings on empty tables --- diff --git a/lib/weblib.php b/lib/weblib.php index f0258fb508..3cfb52b528 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1091,21 +1091,23 @@ function print_table($table) { echo "\n"; } - 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 "$item"; + 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 "$item"; + } + echo "\n"; } - echo "\n"; } echo "\n"; print_simple_box_end();