diff options
| author | 2014-11-16 18:10:55 +0100 | |
|---|---|---|
| committer | 2014-11-16 18:10:55 +0100 | |
| commit | 2c50ed7dc1c11571e3af0ee163e414cc321be2ca (patch) | |
| tree | 93005d06594a95a28f5fcf1a2c55cf2d7bd974d2 /app/Models/Context.php | |
| parent | 4b374ce991b28d179afaf3e4a02a90cb82affa08 (diff) | |
| parent | 960f86ba20fdf7320c957141a9983d17c7e521fa (diff) | |
Merge pull request #694 from FreshRSS/hide-article
Add a feature to hide articles when they are read
Diffstat (limited to 'app/Models/Context.php')
| -rw-r--r-- | app/Models/Context.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php index 36c4087eb..cbd6a5888 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -265,4 +265,26 @@ class FreshRSS_Context { } } } + + /** + * Determine if the auto remove is available in the current context. + * This feature is available if: + * - it is activated in the configuration + * - the "read" state is not enable + * - the "unread" state is enable + * + * @return boolean + */ + public static function isAutoRemoveAvailable() { + if (!self::$conf->auto_remove_article) { + return false; + } + if (self::isStateEnabled(FreshRSS_Entry::STATE_READ)) { + return false; + } + if (!self::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ)) { + return false; + } + return true; + } } |
