diff options
Diffstat (limited to 'app/Models/Context.php')
| -rw-r--r-- | app/Models/Context.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php index 2a58bd4ba..fd0e79fc1 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -35,6 +35,9 @@ class FreshRSS_Context { public static $first_id = ''; public static $next_id = ''; public static $id_max = ''; + public static $sinceHours = 0; + + public static $isCli = false; /** * Initialize the context. @@ -45,9 +48,6 @@ class FreshRSS_Context { // Init configuration. self::$system_conf = Minz_Configuration::get('system'); self::$user_conf = Minz_Configuration::get('user'); - - $catDAO = new FreshRSS_CategoryDAO(); - self::$categories = $catDAO->listCategories(); } /** @@ -139,15 +139,22 @@ class FreshRSS_Context { $id = substr($get, 2); $nb_unread = 0; + if (empty(self::$categories)) { + $catDAO = new FreshRSS_CategoryDAO(); + self::$categories = $catDAO->listCategories(); + } + switch($type) { case 'a': self::$current_get['all'] = true; self::$name = _t('index.feed.title'); + self::$description = self::$system_conf->meta_description; self::$get_unread = self::$total_unread; break; case 's': self::$current_get['starred'] = true; self::$name = _t('index.feed.title_fav'); + self::$description = self::$system_conf->meta_description; self::$get_unread = self::$total_starred['unread']; // Update state if favorite is not yet enabled. @@ -198,11 +205,16 @@ class FreshRSS_Context { /** * Set the value of $next_get attribute. */ - public static function _nextGet() { + private static function _nextGet() { $get = self::currentGet(); // By default, $next_get == $get self::$next_get = $get; + if (empty(self::$categories)) { + $catDAO = new FreshRSS_CategoryDAO(); + self::$categories = $catDAO->listCategories(); + } + if (self::$user_conf->onread_jump_next && strlen($get) > 2) { $another_unread_id = ''; $found_current_get = false; |
