From: Jan Schneider Date: Sun, 4 Jul 2010 15:18:11 +0000 (+0200) Subject: Load attributes, use PHP 5 foreach. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ee158f8e2df3074c3c129d3862d356e829426edf;p=horde.git Load attributes, use PHP 5 foreach. --- diff --git a/turba/lib/List.php b/turba/lib/List.php index 289960d7d..aef8dd3cb 100644 --- a/turba/lib/List.php +++ b/turba/lib/List.php @@ -105,12 +105,12 @@ class Turba_List { $need_lastname = false; $last_first = $GLOBALS['prefs']->getValue('name_format') == 'last_first'; - foreach (array_keys($order) as $key) { - if ($last_first && $order[$key]['field'] == 'name') { - $order[$key]['field'] = 'lastname'; + foreach ($order as &$field) { + if ($last_first && $field['field'] == 'name') { + $field['field'] = 'lastname'; } - if ($order[$key]['field'] == 'lastname') { - $order[$key]['field'] = '__lastname'; + if ($field['field'] == 'lastname') { + $field['field'] = '__lastname'; $need_lastname = true; break; } @@ -149,6 +149,7 @@ class Turba_List { */ function cmp($a, $b) { + require TURBA_BASE . '/config/attributes.php'; foreach ($this->_usortCriteria as $field) { // Set the comparison type based on the type of attribute we're // sorting by.