From 3eb049036e601c1978cf5f7f0d5be8c577933b72 Mon Sep 17 00:00:00 2001 From: NumEricR Date: Tue, 27 Aug 2013 16:02:25 +0200 Subject: Add warning message when there is no entry in current view --- inc/poche/Poche.class.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 57e8b7b3..a8f64151 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -259,13 +259,17 @@ class Poche break; default: # home, favorites and archive views $entries = $this->store->getEntriesByView($view, $this->user->getId()); - $this->pagination->set_total(count($entries)); - $page_links = $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . '&'); - $datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit()); $tpl_vars = array( - 'entries' => $datas, - 'page_links' => $page_links, + 'entries' => '', + 'page_links' => '', ); + if (count($entries) > 0) { + $this->pagination->set_total(count($entries)); + $page_links = $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . '&'); + $datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit()); + $tpl_vars['entries'] = $datas; + $tpl_vars['page_links'] = $page_links; + } Tools::logm('display ' . $view . ' view'); break; } -- cgit v1.2.3