aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-11-22 08:01:31 -0500
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-11-22 08:01:31 -0500
commita3a77b09e96f66eec4e31e638b58c785cfb369a3 (patch)
treecebd17379e554de53a36ca2cd0699175d350afe4 /app/Models/Context.php
parent960f86ba20fdf7320c957141a9983d17c7e521fa (diff)
Add an automatic sticky post configuration
Before, when the article while marked as read while scrolling and auto removed after reading, the display was in the middle of the following article. Now, the article is forced to be a sticky article so the user display is forced to be on top of the following article.
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php
index cbd6a5888..3dc5349ad 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -287,4 +287,22 @@ class FreshRSS_Context {
}
return true;
}
+
+ /**
+ * Determine if the "sticky post" option is enabled. It can be enable
+ * by the user when it is selected in the configuration page or by the
+ * application when the context allows to auto-remove articles when they
+ * are read.
+ *
+ * @return boolean
+ */
+ public static function isStickyPostEnabled() {
+ if (self::$conf->sticky_post) {
+ return true;
+ }
+ if (self::isAutoRemoveAvailable()) {
+ return true;
+ }
+ return false;
+ }
}