From 1dfcc5384667f26de0ff2caa934121a6128f10b3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 5 Oct 2003 23:16:03 +0000 Subject: [PATCH] sorted apps in user-manage after their titel and not after the not shown app-name --- admin/inc/class.uiaccounts.inc.php | 44 ++++++++++-------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index 2f2c9f30bc..15a4279b22 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -1133,48 +1133,34 @@ } /* create list of available apps */ - $i = 0; - $apps = CreateObject('phpgwapi.applications',$_account_id); $db_perms = $apps->read_account_specific(); - @reset($GLOBALS['phpgw_info']['apps']); $availableApps = $GLOBALS['phpgw_info']['apps']; - @asort($availableApps); - @reset($availableApps); - while (list($key,$application) = each($availableApps)) - { - if ($application['enabled'] && $application['status'] != 3) - { - $perm_display[$i]['appName'] = $key; - $perm_display[$i]['title'] = $application['title']; - $i++; - } - } + uasort($availableApps,create_function('$a,$b','return strcasecmp($a["title"],$b["title"]);')); - /* create apps output */ $appRightsOutput = ''; -// @reset($perm_display); - for ($i=0;$i<=count($perm_display);$i++) + $i = 0; + foreach($availableApps as $app => $data) { - $checked = ((($userData['account_permissions'][$perm_display[$i]['appName']] || $db_perms[$perm_display[$i]['appName']]) && $_account_id)?' checked':''); - - if ($perm_display[$i]['title']) + if (!$data['enabled'] || $data['status'] == 3) { - $part[$i&1] = sprintf('%s', - $perm_display[$i]['title'], - $perm_display[$i]['appName'], - $checked); - } - else - { - $part[1] = ' '; + continue; } + $checked = (@$userData['account_permissions'][$app] || @$db_perms[$app]) && $_account_id ? ' checked' : ''; + $part[$i&1] = sprintf('%s', + $data['title'],$app,$checked); if ($i & 1) { - $appRightsOutput .= sprintf('%s%s',$this->nextmatchs->alternate_row_color()/*$GLOBALS['phpgw_info']['theme']['row_on']*/, $part[0], $part[1]); + $appRightsOutput .= sprintf('%s%s',$this->nextmatchs->alternate_row_color(), $part[0], $part[1]); } + ++$i; + } + if ($i & 1) + { + $part[1] = ' '; + $appRightsOutput .= sprintf('%s%s',$this->nextmatchs->alternate_row_color(), $part[0], $part[1]); } $var = Array(