A free, self-hostable news aggregator…
Refactor code for strict unread message display
Alexis Degrugillier71617080e224
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.phpindex f94d82402..ea1556cbb 100644--- a/app/Models/Configuration.php+++ b/app/Models/Configuration.php@@ -147,7 +147,7 @@ class FreshRSS_Configuration {// left blank on purposecase 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.phpindex 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.phpindex 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.phpindex 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.phpindex 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.phtmlindex 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>