From 83832a39c4651bd3e4bfa007f75c91d040db79d3 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 6 Sep 2014 11:32:52 -0400 Subject: Add a new configuration option Before, when you selected the option to display only unread articles, it shows read articles if no unread article were found. Now, this option is renamed to include information on fallback behavior and a new option is created to have the "only unread" behavior See #551 It is missing the german translation --- app/Models/EntryDAO.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 75a8aeba4..dee49212d 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -338,6 +338,9 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { elseif ($state & FreshRSS_Entry::STATE_READ) { $where .= 'AND e1.is_read=1 '; } + elseif ($state & FreshRSS_Entry::STATE_NOT_READ_STRICT) { + $where .= 'AND e1.is_read=0 '; + } if ($state & FreshRSS_Entry::STATE_FAVORITE) { if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) { $where .= 'AND e1.is_favorite=1 '; -- cgit v1.2.3 From 71617080e224b8d3a3397a27b78e1f509499431c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Thu, 18 Sep 2014 21:06:38 -0400 Subject: Refactor code for strict unread message display Before, when you choose the show unread message option and the hide categories and feeds options, the categories and feeds weren't hidden. Now it is working properly. Before, the unread filter icon was not selected with the previous way of using the constants. Now, the filter is highlighted when selected in strict mode. See #619 --- app/Models/Configuration.php | 2 +- app/Models/Entry.php | 3 +-- app/Models/EntryDAO.php | 5 ++--- app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- app/views/configure/reading.phtml | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index f94d82402..ea1556cbb 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -147,7 +147,7 @@ class FreshRSS_Configuration { // left blank on purpose case FreshRSS_Entry::STATE_NOT_READ: // left blank on purpose - case FreshRSS_Entry::STATE_NOT_READ_STRICT: + case FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ: $this->data['default_view'] = $value; break; default: diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 5f1c8abc4..9d7dd5dc4 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -6,8 +6,7 @@ class FreshRSS_Entry extends Minz_Model { const STATE_NOT_READ = 2; const STATE_FAVORITE = 4; const STATE_NOT_FAVORITE = 8; - const STATE_READ_STRICT = 16; - const STATE_NOT_READ_STRICT = 32; + const STATE_STRICT = 16; private $id = 0; private $guid; diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index dee49212d..c1f87ee34 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -333,14 +333,13 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { if ($state & FreshRSS_Entry::STATE_NOT_READ) { if (!($state & FreshRSS_Entry::STATE_READ)) { $where .= 'AND e1.is_read=0 '; + } elseif ($state & FreshRSS_Entry::STATE_STRICT) { + $where .= 'AND e1.is_read=0 '; } } elseif ($state & FreshRSS_Entry::STATE_READ) { $where .= 'AND e1.is_read=1 '; } - elseif ($state & FreshRSS_Entry::STATE_NOT_READ_STRICT) { - $where .= 'AND e1.is_read=0 '; - } if ($state & FreshRSS_Entry::STATE_FAVORITE) { if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) { $where .= 'AND e1.is_favorite=1 '; diff --git a/app/i18n/en.php b/app/i18n/en.php index 8598e61cb..c53adb409 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -281,7 +281,7 @@ return array ( 'auto_load_more' => 'Load next articles at the page bottom', 'display_articles_unfolded' => 'Show articles unfolded by default', 'display_categories_unfolded' => 'Show categories folded by default', - 'hide_read_feeds' => 'Hide categories & feeds with no unread article (only in “unread articles” display mode)', + 'hide_read_feeds' => 'Hide categories & feeds with no unread article (does not work with “Show all articles” configuration)', 'after_onread' => 'After “mark all as read”,', 'jump_next' => 'jump to next unread sibling (feed or category)', 'article_icons' => 'Article icons', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 4af819cac..58dccd2d4 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -281,7 +281,7 @@ return array ( 'auto_load_more' => 'Charger les articles suivants en bas de page', 'display_articles_unfolded' => 'Afficher les articles dépliés par défaut', 'display_categories_unfolded' => 'Afficher les catégories pliées par défaut', - 'hide_read_feeds' => 'Cacher les catégories & flux sans article non-lu (uniquement en affichage “articles non lus”)', + 'hide_read_feeds' => 'Cacher les catégories & flux sans article non-lu (ne fonctionne pas avec la configuration “Afficher tous les articles”)', 'after_onread' => 'Après “marquer tout comme lu”,', 'jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)', 'article_icons' => 'Icônes d’article', diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index 3dd457a2b..86d816eb3 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -43,7 +43,7 @@ -- cgit v1.2.3