diff options
| author | 2014-09-06 11:32:52 -0400 | |
|---|---|---|
| committer | 2014-09-06 11:32:52 -0400 | |
| commit | 83832a39c4651bd3e4bfa007f75c91d040db79d3 (patch) | |
| tree | 4330025cae9dacb06a3de091a4992235c9a121b6 /app/Models | |
| parent | c3fd8877c021b86180b3bea4d4260e6478f0558e (diff) | |
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
Diffstat (limited to 'app/Models')
| -rw-r--r-- | app/Models/Configuration.php | 13 | ||||
| -rw-r--r-- | app/Models/Entry.php | 2 | ||||
| -rw-r--r-- | app/Models/EntryDAO.php | 3 |
3 files changed, 17 insertions, 1 deletions
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 3a408faa5..92bab6ad9 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -141,7 +141,18 @@ class FreshRSS_Configuration { } } public function _default_view ($value) { - $this->data['default_view'] = $value === FreshRSS_Entry::STATE_ALL ? FreshRSS_Entry::STATE_ALL : FreshRSS_Entry::STATE_NOT_READ; + switch ($value): + case FreshRSS_Entry::STATE_ALL: + // left blank on purpose + case FreshRSS_Entry::STATE_NOT_READ: + // left blank on purpose + case FreshRSS_Entry::STATE_NOT_READ_STRICT: + $this->data['default_view'] = $value; + break; + default: + $this->data['default_view'] = FreshRSS_Entry::STATE_ALL; + break; + endswitch; } public function _display_posts ($value) { $this->data['display_posts'] = ((bool)$value) && $value !== 'no'; diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 0bf1f2616..5f1c8abc4 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -6,6 +6,8 @@ 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; private $id = 0; private $guid; 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 '; |
