From 7a2eb18348f4c929e7c55e70b6847fee7d417d8c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 4 Apr 2010 12:52:20 +0000 Subject: [PATCH] sort available types --- lam/templates/config/conftypes.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lam/templates/config/conftypes.php b/lam/templates/config/conftypes.php index c9739a9f..9ea3be0b 100644 --- a/lam/templates/config/conftypes.php +++ b/lam/templates/config/conftypes.php @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2004 - 2009 Roland Gruber + Copyright (C) 2004 - 2010 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -104,8 +104,11 @@ $allTypes = getTypes(); $activeTypes = $conf->get_ActiveTypes(); $availableTypes = array(); for ($i = 0; $i < sizeof($allTypes); $i++) { - if (!in_array($allTypes[$i], $activeTypes)) $availableTypes[] = $allTypes[$i]; + if (!in_array($allTypes[$i], $activeTypes)) { + $availableTypes[$allTypes[$i]] = getTypeAlias($allTypes[$i]); + } } +natcasesort($availableTypes); echo $_SESSION['header']; @@ -210,12 +213,12 @@ echo "

\n"; if (sizeof($availableTypes) > 0) { echo "
" . _("Available account types") . "\n"; echo "\n"; - for ($i = 0; $i < sizeof($availableTypes); $i++) { - $icon = '' . $availableTypes[$i] . ' '; + foreach ($availableTypes as $key => $value) { + $icon = '' . $value . ' '; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; }
$icon" . getTypeAlias($availableTypes[$i]) . ": " . getTypeDescription($availableTypes[$i]) . "$icon" . $value . ": " . getTypeDescription($key) . "