RFE #772991 - shorten dropdown fields

This commit is contained in:
Garvin Hicking
2003-08-05 17:28:50 +00:00
parent 5becc1f284
commit a740693bdc
2 changed files with 14 additions and 1 deletions

View File

@@ -8,6 +8,8 @@ $Source$
2003-08-05 Garvin Hicking <me@supergarv.de> 2003-08-05 Garvin Hicking <me@supergarv.de>
* libraries/common.lib.php3: Moved docu function (PHP3 compatbility) * libraries/common.lib.php3: Moved docu function (PHP3 compatbility)
(Bug #782966) (Bug #782966)
* tbl_change.php3: RFE #772991: Shorten dropdown field using
$cfg['LimitChars']
2003-08-05 Michal Cihar <nijel@users.sourceforge.net> 2003-08-05 Michal Cihar <nijel@users.sourceforge.net>
* sql.php3: Fixed regular expression. * sql.php3: Fixed regular expression.

View File

@@ -440,8 +440,19 @@ for ($i = 0; $i < $fields_cnt; $i++) {
echo "\n"; echo "\n";
while ($relrow = @PMA_mysql_fetch_array($disp)) { while ($relrow = @PMA_mysql_fetch_array($disp)) {
$key = $relrow[$foreign_field]; $key = $relrow[$foreign_field];
$value = (($foreign_display != FALSE) ? '&nbsp;-&nbsp;' . htmlspecialchars($relrow[$foreign_display]) : ''); if (strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) {
$value = (($foreign_display != FALSE) ? '&nbsp;-&nbsp;' . htmlspecialchars($relrow[$foreign_display]) : '');
$vtitle = '';
} else {
$vtitle = htmlspecialchars($relrow[$foreign_display]);
$value = (($foreign_display != FALSE) ? '&nbsp;-&nbsp;' . htmlspecialchars(substr($vtitle, 0, $cfg['LimitChars']) . '...') : '');
}
echo ' <option value="' . htmlspecialchars($key) . '"'; echo ' <option value="' . htmlspecialchars($key) . '"';
if ($vtitle != '') {
echo ' title="' . $vtitle . '"';
}
if ($key == $data) { if ($key == $data) {
echo ' selected="selected"'; echo ' selected="selected"';
} // end if } // end if