From e94e5024dc74f506ba41776c13c7464f7b39148d Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Tue, 8 Feb 2005 20:38:30 +0000 Subject: [PATCH] bug 288 : fixed, ordre des criteres de tri git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-461 --- include/search.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/search.inc.php b/include/search.inc.php index 5402510..271bab1 100644 --- a/include/search.inc.php +++ b/include/search.inc.php @@ -33,9 +33,9 @@ class XOrgSearch extends XOrgPlugin var $order_defaut = 'promo'; // type of orders : (field name, default ASC, text name, auth) var $orders = array( - 'promo' =>array('promo', false, 'promotion', AUTH_PUBLIC), 'nom' =>array('nom,prenom', true, 'nom', AUTH_PUBLIC), - 'date_mod' =>array('u.date', false, 'dernière modification', AUTH_COOKIE) + 'promo' =>array('promo,nom', false, 'promotion', AUTH_PUBLIC), + 'date_mod' =>array('u.date,nom', false, 'dernière modification', AUTH_COOKIE) ); // }}} @@ -65,8 +65,12 @@ class XOrgSearch extends XOrgPlugin function addOrder($name, $field, $inv_order, $text, $auth, $defaut=false) { + // reverse the array, to get the defaut order first + if ($defaut) + $this->orders = array_reverse($this->orders); $this->orders[$name] = array($field, $inv_order, $text, $auth); if ($defaut) { + $this->orders = array_reverse($this->orders); $this->order_defaut = $name; } } -- 2.1.4