From 867069d099f39b0e5e122641d8b4f2ae096b6506 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Mon, 24 Feb 2014 18:57:45 -0500 Subject: Show only unread when selecting unread Before, when there was no unread articles, all articles where displayed. This behaviour was not the one intended. Now, when there is no unread articles, a message is displayed to alert that there is no article. See #428 --- app/Controllers/indexController.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 38f4c0e7c..04b26d686 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -111,9 +111,6 @@ class FreshRSS_index_Controller extends Minz_ActionController { $hasUnread = true; break; } - if (!$hasUnread) { - $this->view->state = $state = 'all'; - } } $today = @strtotime('today'); @@ -127,14 +124,6 @@ class FreshRSS_index_Controller extends Minz_ActionController { try { $entries = $entryDAO->listWhere($getType, $getId, $state, $order, $nb + 1, $first, $filter, $date_min, $keepHistoryDefault); - // Si on a récupéré aucun article "non lus" - // on essaye de récupérer tous les articles - if ($state === 'not_read' && empty($entries)) { - Minz_Log::record ('Conflicting information about nbNotRead!', Minz_Log::DEBUG); - $this->view->state = 'all'; - $entries = $entryDAO->listWhere($getType, $getId, 'all', $order, $nb, $first, $filter, $date_min, $keepHistoryDefault); - } - if (count($entries) <= $nb) { $this->view->nextId = ''; } else { //We have more elements for pagination -- cgit v1.2.3 From 736ee492a0fe723b0d6ce9ea59fb3f3eef7ecf23 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 1 Mar 2014 14:30:55 -0500 Subject: Show only unread when selecting unread Before, when there was no unread articles, all articles where displayed. This behaviour was not the one intended. Now, when there is no unread articles, a message is displayed to alert that there is no article. See #428 Correction after comment --- app/Controllers/indexController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 38f4c0e7c..c760e0f01 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -84,6 +84,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { // On récupère les différents éléments de filtrage $this->view->state = $state = Minz_Request::param ('state', $this->view->conf->default_view); + $state_param = Minz_Request::param ('state', null); $filter = Minz_Request::param ('search', ''); if (!empty($filter)) { $state = 'all'; //Search always in read and unread articles @@ -111,7 +112,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { $hasUnread = true; break; } - if (!$hasUnread) { + if (!$hasUnread && is_null($state_param)) { $this->view->state = $state = 'all'; } } @@ -129,7 +130,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { // Si on a récupéré aucun article "non lus" // on essaye de récupérer tous les articles - if ($state === 'not_read' && empty($entries)) { + if ($state === 'not_read' && empty($entries) && is_null($state_param)) { Minz_Log::record ('Conflicting information about nbNotRead!', Minz_Log::DEBUG); $this->view->state = 'all'; $entries = $entryDAO->listWhere($getType, $getId, 'all', $order, $nb, $first, $filter, $date_min, $keepHistoryDefault); -- cgit v1.2.3