Insert - swap order
This commit is contained in:
@@ -10,6 +10,7 @@ $Source$
|
||||
(Bug #782966)
|
||||
* tbl_change.php3: RFE #772991: Shorten dropdown field using
|
||||
$cfg['LimitChars']
|
||||
* tbl_change.php3: RFE #762221: Swap relational insert key order
|
||||
|
||||
2003-08-05 Michal Cihar <nijel@users.sourceforge.net>
|
||||
* sql.php3: Fixed regular expression.
|
||||
|
@@ -438,26 +438,38 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
||||
<option value=""></option>
|
||||
<?php
|
||||
echo "\n";
|
||||
$reloptions = array('content-id' => array(), 'id-content' => array());
|
||||
while ($relrow = @PMA_mysql_fetch_array($disp)) {
|
||||
$key = $relrow[$foreign_field];
|
||||
if (strlen($relrow[$foreign_display]) <= $cfg['LimitChars']) {
|
||||
$value = (($foreign_display != FALSE) ? ' - ' . htmlspecialchars($relrow[$foreign_display]) : '');
|
||||
$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']) . '...') : '');
|
||||
$value = (($foreign_display != FALSE) ? htmlspecialchars(substr($vtitle, 0, $cfg['LimitChars']) . '...') : '');
|
||||
}
|
||||
|
||||
echo ' <option value="' . htmlspecialchars($key) . '"';
|
||||
$reloption = ' <option value="' . htmlspecialchars($key) . '"';
|
||||
if ($vtitle != '') {
|
||||
echo ' title="' . $vtitle . '"';
|
||||
$reloption .= ' title="' . $vtitle . '"';
|
||||
}
|
||||
|
||||
if ($key == $data) {
|
||||
echo ' selected="selected"';
|
||||
$reloption .= ' selected="selected"';
|
||||
} // end if
|
||||
echo '>' . htmlspecialchars($key) . $value . '</option>' . "\n";
|
||||
|
||||
$reloptions['id-content'][] = $reloption . '>' . $value . ' - ' . htmlspecialchars($key) . '</option>' . "\n";
|
||||
$reloptions['content-id'][] = $reloption . '>' . htmlspecialchars($key) . ' - ' . $value . '</option>' . "\n";
|
||||
} // end while
|
||||
|
||||
if (count($reloptions['content-id']) < 100) {
|
||||
echo implode('', $reloptions['content-id']);
|
||||
if (count($reloptions['content-id']) > 0) {
|
||||
echo ' <option value=""></option>' . "\n";
|
||||
echo ' <option value=""></option>' . "\n";
|
||||
}
|
||||
}
|
||||
echo implode('', $reloptions['id-content']);
|
||||
echo ' </select>' . "\n";
|
||||
echo ' </td>' . "\n";
|
||||
unset($disp);
|
||||
|
Reference in New Issue
Block a user