From b0a8daa8a2428ffc76ea4eb690ab8379cdc22aec Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 10 Apr 2010 17:56:38 +0200 Subject: [PATCH] PlSet provides the keys of the set in smarty. Also fix a minor warning. Signed-off-by: Florent Bruneau --- classes/plset.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)); -- 2.1.4