From 79dd7c04561a9547f8da8bdfd165764686da6d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Wed, 29 Aug 2001 17:58:05 +0000 Subject: [PATCH] added an option to display the whole value of a text field in a javascript alert box --- lib.inc.php3 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib.inc.php3 b/lib.inc.php3 index b8c1daf39..1495c45a0 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -1152,11 +1152,20 @@ var errorMsg2 = '[BLOB]' . "\n"; } else { if (strlen($row[$i]) > $GLOBALS['cfgLimitChars']) { - $row[$i] = substr($row[$i], 0, $GLOBALS['cfgLimitChars']) . '...'; + // loic1: added a link to display the whole text + // field in a js alert box + $alert = ''; + $tmp = explode("\n", str_replace("\r", ' ', $row[$i])); + for ($j = 0; $j < count($tmp); $j++) { + $alert .= addslashes(str_replace('"', '"', trim($tmp[$j]))) . '\n'; + } + unset($tmp); + $row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '
', htmlspecialchars($row[$i])); + $row[$i] = substr($row[$i], 0, $GLOBALS['cfgLimitChars']) + . '... ' + . '[+]'; } - // loic1 : displays / if ($row[$i] != '') { - $row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '
', htmlspecialchars($row[$i])); echo ' ' . $row[$i] . '' . "\n"; } else { echo '  ' . "\n";