Allow selection of drop-down order.

This commit is contained in:
Robin Johnson
2005-06-22 16:45:17 +00:00
parent 321bfbfb4f
commit 3576fd016a
2 changed files with 21 additions and 5 deletions

View File

@@ -266,6 +266,7 @@ $cfg['CharEditing'] = 'input';
// input - allows limiting of input length
// textarea - allows newlines in fields
$cfg['InsertRows'] = 2; // How many rows can be inserted at one time
$cfg['InsertDropdownOrder'] = FALSE; // Ordering for elements in dropdown.
// For the export features...
$cfg['ZipDump'] = TRUE; // Allow the use of zip/gzip/bzip
@@ -823,6 +824,11 @@ $cfg['EnumOperators'] = array(
'!='
);
$cfg['SetOperators'] = array(
'IN',
'NOT IN'
);
$cfg['NullOperators'] = array(
'IS NULL',
'IS NOT NULL'

View File

@@ -836,15 +836,25 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma
asort($reloptions['content-id']);
}
if ($max == -1 || count($reloptions['content-id']) < $max) {
$ret .= implode('', $reloptions['content-id']);
if (count($reloptions['content-id']) > 0) {
if ($cfg['InsertDropdownOrder']) {
$top = $reloptions['content-id'];
$bot = $reloptions['id-content'];
} else {
$top = $reloptions['id-content'];
$bot = $reloptions['content-id'];
}
$str_top = implode('', $top);
$str_bot = implode('', $bot);
$top_count = count($top);
if ($max == -1 || $top_count < $max) {
$ret .= $str_top;
if ($top_count > 0) {
$ret .= '<option value=""></option>' . "\n";
$ret .= '<option value=""></option>' . "\n";
}
}
$ret .= implode('', $reloptions['id-content']);
$ret .= $str_bot;
return $ret;
} // end of 'PMA_foreignDropdown()' function