sort available types

This commit is contained in:
Roland Gruber 2010-04-04 15:00:06 +00:00
parent cc4db6d9c7
commit bbe9f616bd
1 changed files with 9 additions and 4 deletions

View File

@ -69,16 +69,21 @@ if(isset($_POST['createNewTemplate'])) {
} }
$scopes = $_SESSION['config']->get_ActiveTypes(); $scopes = $_SESSION['config']->get_ActiveTypes();
$sortedScopes = array();
for ($i = 0; $i < sizeof($scopes); $i++) {
$sortedScopes[$scopes[$i]] = getTypeAlias($scopes[$i]);
}
natcasesort($sortedScopes);
// get list of account types // get list of account types
$availableScopes = ''; $availableScopes = '';
$templateClasses = array(); $templateClasses = array();
for ($i = 0; $i < sizeof($scopes); $i++) { foreach ($sortedScopes as $scope => $title) {
$templateClasses[] = array( $templateClasses[] = array(
'scope' => $scopes[$i], 'scope' => $scope,
'title' => getTypeAlias($scopes[$i]), 'title' => $title,
'templates' => ""); 'templates' => "");
$availableScopes .= '<option value="' . $scopes[$i] . '">' . getTypeAlias($scopes[$i]) . "</option>\n"; $availableScopes .= '<option value="' . $scope . '">' . $title . "</option>\n";
} }
// get list of templates for each account type // get list of templates for each account type
for ($i = 0; $i < sizeof($templateClasses); $i++) { for ($i = 0; $i < sizeof($templateClasses); $i++) {