From bbe9f616bd36ba23e85990e67e5a4542bcae8225 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 4 Apr 2010 15:00:06 +0000 Subject: [PATCH] sort available types --- lam/templates/pdfedit/pdfmain.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lam/templates/pdfedit/pdfmain.php b/lam/templates/pdfedit/pdfmain.php index 2a17b1c5..8a41296c 100644 --- a/lam/templates/pdfedit/pdfmain.php +++ b/lam/templates/pdfedit/pdfmain.php @@ -69,16 +69,21 @@ if(isset($_POST['createNewTemplate'])) { } $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 $availableScopes = ''; $templateClasses = array(); -for ($i = 0; $i < sizeof($scopes); $i++) { +foreach ($sortedScopes as $scope => $title) { $templateClasses[] = array( - 'scope' => $scopes[$i], - 'title' => getTypeAlias($scopes[$i]), + 'scope' => $scope, + 'title' => $title, 'templates' => ""); - $availableScopes .= '\n"; + $availableScopes .= '\n"; } // get list of templates for each account type for ($i = 0; $i < sizeof($templateClasses); $i++) {