sort lists

This commit is contained in:
Roland Gruber 2010-04-04 14:41:39 +00:00
parent 7a2eb18348
commit 78e7037dfb
1 changed files with 9 additions and 3 deletions

View File

@ -86,9 +86,10 @@ for ($i = 0; $i < sizeof($profileClasses); $i++) {
// get list of profiles for each account type // get list of profiles for each account type
for ($i = 0; $i < sizeof($profileClasses); $i++) { for ($i = 0; $i < sizeof($profileClasses); $i++) {
$profileList = getAccountProfiles($profileClasses[$i]['scope']); $profileList = getAccountProfiles($profileClasses[$i]['scope']);
natcasesort($profileList);
$profiles = ""; $profiles = "";
for ($l = 0; $l < sizeof($profileList); $l++) { foreach ($profileList as $p) {
$profiles = $profiles . "<option>" . $profileList[$l] . "</option>\n"; $profiles = $profiles . "<option>" . $p . "</option>\n";
} }
$profileClasses[$i]['profiles'] = $profiles; $profileClasses[$i]['profiles'] = $profiles;
} }
@ -108,8 +109,13 @@ echo "</legend>\n";
echo "<br><table border=0>\n"; echo "<br><table border=0>\n";
echo "<tr><td>\n"; echo "<tr><td>\n";
echo "<select class=\"user\" name=\"createProfile\">\n"; echo "<select class=\"user\" name=\"createProfile\">\n";
$sortedTypes = array();
for ($i = 0; $i < sizeof($profileClasses); $i++) { for ($i = 0; $i < sizeof($profileClasses); $i++) {
echo "<option value=\"" . $profileClasses[$i]['scope'] . "\">" . $profileClasses[$i]['title'] . "</option>\n"; $sortedTypes[$profileClasses[$i]['scope']] = $profileClasses[$i]['title'];
}
natcasesort($sortedTypes);
foreach ($sortedTypes as $key => $value) {
echo "<option value=\"" . $key . "\">" . $value . "</option>\n";
} }
echo "</select>\n"; echo "</select>\n";
echo "</td>\n"; echo "</td>\n";