From: Florent Bruneau Date: Sat, 10 Apr 2010 15:56:38 +0000 (+0200) Subject: PlSet provides the keys of the set in smarty. X-Git-Tag: core/1.1.0~28 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=b0a8daa8a2428ffc76ea4eb690ab8379cdc22aec;p=platal.git PlSet provides the keys of the set in smarty. Also fix a minor warning. Signed-off-by: Florent Bruneau --- diff --git a/classes/plset.php b/classes/plset.php index fc96f17..1c29af2 100644 --- a/classes/plset.php +++ b/classes/plset.php @@ -94,7 +94,8 @@ abstract class PlSet */ protected function &getFilterResults(PlFilter &$pf, PlLimit $limit) { - return $pf->get($limit); + $res = $pf->get($limit); + return $res; } /** This function returns the values of the set @@ -341,6 +342,9 @@ abstract class MultipageView implements PlView $page->assign('order', Env::v('order', $this->defaultkey)); $page->assign('orders', $this->sortkeys); $page->assign_by_ref('plview', $this); + if (is_array($res)) { + $page->assign('set_keys', array_keys($res)); + } $page->assign_by_ref('set', $res); $count = $this->set->count(); $this->pages = intval(ceil($count / $this->entriesPerPage));