diff options
| author | 2016-10-30 20:15:11 +0100 | |
|---|---|---|
| committer | 2016-10-30 20:15:11 +0100 | |
| commit | 1d3e5bdee069434fd65c2717ae8fcce8c54fe81d (patch) | |
| tree | 39b0ae9ac0b0d1ed7fa11c747a0523cb3faa384b /app/Models/Context.php | |
| parent | 17c8c039df675b3b0f8d88d14f7316a240eabe76 (diff) | |
| parent | 29e1f048159b7a580bdf1bab184e928f11d104b4 (diff) | |
Merge pull request #1346 from FreshRSS/dev1.6.0
Merge 1.6.0-dev in master
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; |
