aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-11-02 10:05:26 -0500
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-11-02 10:05:26 -0500
commit960f86ba20fdf7320c957141a9983d17c7e521fa (patch)
treeef89206983c84f4bd91d1482bcbab0457384a632 /app/Models/Context.php
parent0eae6ef6b41085e83f7ad9f946cd9cb116542759 (diff)
Add a feature to hide articles when they are read
This is a new reading option to hide articles when they are read. The hidding process occurs when the article is left for an other article. This way, even when the article is marked as read on opening, it is hidden only while navigating to an other article. I'm not really happy with the behavior when the "mark while scrolling" option is enabled. Please review. It is missing the i18n since we're not supposed to push them before it exists on i18n.freshrss.org. Or maybe I misunderstood the process. See #476
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php22
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;
+ }
}