aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-09-19 13:40:59 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-09-19 13:40:59 +0200
commit24f7a6559401bf8c1f21082d5401a3bdb3b7c093 (patch)
tree7557c80d42d55a3168fefcd519ca00f54e4953f3
parent7984e52bbc653ac00b83c513a2acb649f6f28af1 (diff)
parent71617080e224b8d3a3397a27b78e1f509499431c (diff)
Merge pull request #626 from aledeg/unread-error
Refactor code for strict unread message display
-rw-r--r--app/Models/Configuration.php2
-rw-r--r--app/Models/Entry.php3
-rw-r--r--app/Models/EntryDAO.php5
-rw-r--r--app/i18n/en.php2
-rw-r--r--app/i18n/fr.php2
-rw-r--r--app/views/configure/reading.phtml2
6 files changed, 7 insertions, 9 deletions
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 &amp; feeds with no unread article (only in “unread articles” display mode)',
+ 'hide_read_feeds' => 'Hide categories &amp; 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 &amp; flux sans article non-lu (uniquement en affichage “articles non lus”)',
+ 'hide_read_feeds' => 'Cacher les catégories &amp; 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 @@
<select name="default_view" id="default_view">
<option value="<?php echo FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_adaptive'); ?></option>
<option value="<?php echo FreshRSS_Entry::STATE_ALL; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_ALL ? ' selected="selected"' : ''; ?>><?php echo _t('show_all_articles'); ?></option>
- <option value="<?php echo FreshRSS_Entry::STATE_NOT_READ_STRICT; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_NOT_READ_STRICT ? ' selected="selected"' : ''; ?>><?php echo _t('show_not_reads'); ?></option>
+ <option value="<?php echo FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_not_reads'); ?></option>
</select>
</div>
</div>