Pull-request: #19331 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
de85bcb05c
@ -3612,9 +3612,9 @@ Various display setting
|
||||
:type: boolean
|
||||
:default: true
|
||||
|
||||
Sorts database and table names according to natural order (for
|
||||
example, t1, t2, t10). Currently implemented in the navigation panel
|
||||
and in Database view, for the table list.
|
||||
Sorts database, table names and foreign key constaint according to natural order (for
|
||||
example, t1, t2, t10). Currently implemented in the navigation panel,
|
||||
in Database view for the table list and Relation view while listing Foreign key constraints.
|
||||
|
||||
.. config:option:: $cfg['InitialSlidersState']
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ use PhpMyAdmin\Indexes\Index;
|
||||
use PhpMyAdmin\MessageType;
|
||||
use PhpMyAdmin\ResponseRenderer;
|
||||
use PhpMyAdmin\Routing\Route;
|
||||
use PhpMyAdmin\SqlParser\Utils\ForeignKey as ForeignKeyObject;
|
||||
use PhpMyAdmin\Table\Table;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\UrlParams;
|
||||
@ -28,6 +29,7 @@ use function __;
|
||||
use function array_keys;
|
||||
use function md5;
|
||||
use function strnatcasecmp;
|
||||
use function strnatcmp;
|
||||
use function uksort;
|
||||
use function usort;
|
||||
|
||||
@ -179,6 +181,13 @@ final readonly class RelationController implements InvocableController
|
||||
|
||||
if ($this->config->settings['NaturalOrder']) {
|
||||
uksort($columnArray, strnatcasecmp(...));
|
||||
usort(
|
||||
$relationsForeign,
|
||||
static fn (ForeignKeyObject $before, ForeignKeyObject $after) => strnatcmp(
|
||||
$before->constraint ?? '',
|
||||
$after->constraint ?? '',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$foreignKeyRow = '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user