From bc49005a2e117875d7eec735cc7c71e729eeaa79 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 2 Nov 2021 00:33:08 +0100 Subject: [PATCH] use lexical sort --- index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index fe981b7..eae0213 100644 --- a/index.php +++ b/index.php @@ -51,14 +51,17 @@ if (!isset($core->themes)) { $core->themes->loadModules($core->blog->themes_path, null); } -$combo_modules = [__('Select a module') => '-']; +$combo_modules = []; $modules = $type == 'plugin' ? $core->plugins->getModules() : $core->themes->getModules(); foreach ($modules as $id => $m) { if (!$m['root_writable'] || !$allow_distrib && in_array($id, $official[$type])) { continue; } - $combo_modules[$m['name']] = $id; + $combo_modules[__($m['name'])] = $id; } +dcUtils::lexicalKeySort($combo_modules); +$combo_modules = array_merge([__('Select a module') => '-'], $combo_modules); + $module = $_REQUEST['module'] ?? ''; if (!in_array($module, $combo_modules)) { $module = '-';