From c469625d0b571675af135fa468e77ab829a06aa8 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 8 Aug 2004 18:20:47 +0000 Subject: [PATCH] natural order sort if possible --- ChangeLog | 1 + libraries/relation.lib.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 80a37c51b..8d3427e0f 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ $Source$ * libraries/relation.lib.php: bug 1005414, undefined offset when no display field has been defined; bug 1004546, sort error in dropdown list of foreign values; incorrect result was freed + * libraries/relation.lib.php: use natural order sort according to config 2004-08-08 Michal Čihař * calendar.php: Include correct stylesheet (bug #1005421). diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 619add34c..a7eabb041 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -654,7 +654,11 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma } // end while // the list of keys looks better if not sorted by description - asort($reloptions['content-id']); + if ($cfg['NaturalOrder']) { + natsort($reloptions['content-id']); } + else { + asort($reloptions['content-id']); + } if ($max == -1 || count($reloptions['content-id']) < $max) { $ret .= implode('', $reloptions['content-id']);