summaryrefslogtreecommitdiff
path: root/app/Controllers/indexController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-04-15 10:10:29 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-04-15 10:10:29 +0200
commit339a12698c07eb466c6a1ab8ffa856d8a8e1f506 (patch)
treed599dd61687b5b4ccd5aa07ae5c500533dc4bcef /app/Controllers/indexController.php
parent951a137f2d05594dd0b61b9d86567cf4e9a12f5a (diff)
parentbdd7b7b13e6fdcdb9110cbee3618bf2b5fc89b71 (diff)
Merge pull request #486 from aledeg/simple-layout
New toggle buttons to filter articles (was: Delete favorite button)
Diffstat (limited to 'app/Controllers/indexController.php')
-rwxr-xr-xapp/Controllers/indexController.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 9da1e5022..3445c0bd4 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -85,18 +85,19 @@ class FreshRSS_index_Controller extends Minz_ActionController {
$state_param = Minz_Request::param ('state', null);
$filter = Minz_Request::param ('search', '');
if (!empty($filter)) {
- $state = 'all'; //Search always in read and unread articles
+ $state = FreshRSS_Entry::STATE_ALL; //Search always in read and unread articles
}
$this->view->order = $order = Minz_Request::param ('order', $this->view->conf->sort_order);
$nb = Minz_Request::param ('nb', $this->view->conf->posts_per_page);
$first = Minz_Request::param ('next', '');
- if ($state === 'not_read') { //Any unread article in this category at all?
+ if ($state === FreshRSS_Entry::STATE_NOT_READ) { //Any unread article in this category at all?
switch ($getType) {
case 'a':
$hasUnread = $this->view->nb_not_read > 0;
break;
case 's':
+ // This is deprecated. The favorite button does not exist anymore
$hasUnread = $this->view->nb_favorites['unread'] > 0;
break;
case 'c':
@@ -111,7 +112,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
break;
}
if (!$hasUnread && ($state_param === null)) {
- $this->view->state = $state = 'all';
+ $this->view->state = $state = FreshRSS_Entry::STATE_ALL;
}
}
@@ -128,10 +129,10 @@ 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) && ($state_param === null)) {
+ if ($state === FreshRSS_Entry::STATE_NOT_READ && empty($entries) && ($state_param === null)) {
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, true, $keepHistoryDefault);
+ $this->view->state = FreshRSS_Entry::STATE_ALL;
+ $entries = $entryDAO->listWhere($getType, $getId, $this->view->state, $order, $nb, $first, $filter, $date_min, true, $keepHistoryDefault);
}
if (count($entries) <= $nb) {