Merge pull request #710 from FreshRSS/hide-article

Add an automatic sticky post configuration
This commit is contained in:
Alexis Degrugillier
2014-11-22 08:05:21 -05:00
2 changed files with 19 additions and 1 deletions

View File

@@ -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;
}
}

View File

@@ -27,7 +27,7 @@ echo 'var context={',
'auto_load_more:', FreshRSS_Context::$conf->auto_load_more ? 'true' : 'false', ',',
'auto_actualize_feeds:', $auto_actualize ? 'true' : 'false', ',',
'does_lazyload:', FreshRSS_Context::$conf->lazyload ? 'true' : 'false', ',',
'sticky_post:', FreshRSS_Context::$conf->sticky_post ? 'true' : 'false', ',',
'sticky_post:', FreshRSS_Context::isStickyPostEnabled() ? 'true' : 'false', ',',
'html5_notif_timeout:', FreshRSS_Context::$conf->html5_notif_timeout, ',',
'auth_type:"', Minz_Configuration::authType(), '",',
'current_user_mail:', $mail ? ('"' . $mail . '"') : 'null', ',',