outputtxt : allow the titles to be longer than the datas, without error

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2170 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-05-13 13:25:47 +00:00
parent d88dbce612
commit 9f2cebdff8

View File

@@ -58,9 +58,18 @@ class outputtxt extends output
}
}
if ($this->table === true)
{
// Display the table if it is not a tree format
// Check if the titles are longer than the data
foreach (reset ($data) as $key=>$val)
{
if (strlen ($key) > $sizes[$key])
$sizes[$key] = strlen ($key);
}
// Prepare the border
$line = reset ($data);
$border = "";