From 3576fd016a9ea394d51ea10656e325a356aa80af Mon Sep 17 00:00:00 2001 From: Robin Johnson Date: Wed, 22 Jun 2005 16:45:17 +0000 Subject: [PATCH] Allow selection of drop-down order. --- config.inc.php | 6 ++++++ libraries/relation.lib.php | 20 +++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/config.inc.php b/config.inc.php index 9dfcd1058..070d5c4b1 100644 --- a/config.inc.php +++ b/config.inc.php @@ -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' diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 42138b6e6..f09276d3f 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -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 .= '' . "\n"; $ret .= '' . "\n"; } } - - $ret .= implode('', $reloptions['id-content']); + $ret .= $str_bot; return $ret; } // end of 'PMA_foreignDropdown()' function