From a740693bdc251b4e96c8543e645cfec88e094d1f Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Tue, 5 Aug 2003 17:28:50 +0000 Subject: [PATCH] RFE #772991 - shorten dropdown fields --- ChangeLog | 2 ++ tbl_change.php3 | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d35a26a46..439b1aa4d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ $Source$ 2003-08-05 Garvin Hicking * libraries/common.lib.php3: Moved docu function (PHP3 compatbility) (Bug #782966) + * tbl_change.php3: RFE #772991: Shorten dropdown field using + $cfg['LimitChars'] 2003-08-05 Michal Cihar * sql.php3: Fixed regular expression. diff --git a/tbl_change.php3 b/tbl_change.php3 index 975c81e32..415096691 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -440,8 +440,19 @@ for ($i = 0; $i < $fields_cnt; $i++) { echo "\n"; while ($relrow = @PMA_mysql_fetch_array($disp)) { $key = $relrow[$foreign_field]; - $value = (($foreign_display != FALSE) ? ' - ' . htmlspecialchars($relrow[$foreign_display]) : ''); + if (strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) { + $value = (($foreign_display != FALSE) ? ' - ' . htmlspecialchars($relrow[$foreign_display]) : ''); + $vtitle = ''; + } else { + $vtitle = htmlspecialchars($relrow[$foreign_display]); + $value = (($foreign_display != FALSE) ? ' - ' . htmlspecialchars(substr($vtitle, 0, $cfg['LimitChars']) . '...') : ''); + } + echo '