diff options
| author | 2015-01-15 14:17:00 +0100 | |
|---|---|---|
| committer | 2015-01-15 14:17:00 +0100 | |
| commit | eaf6c2c33e3c058bd6890c9fb30308b13727b19d (patch) | |
| tree | 6a797374b348e5a42ddd5b8dc26079525f9194eb /app/Models/Context.php | |
| parent | caa274c75b6a7471f09f9c21057749c686e155fb (diff) | |
| parent | 4c143426712f75fa04999f4e8b3c0b6900bf062d (diff) | |
Merge branch 'dev' into beta
Diffstat (limited to 'app/Models/Context.php')
| -rw-r--r-- | app/Models/Context.php | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php index c8a65063a..1c770c756 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -5,7 +5,8 @@ * useful functions associated to the current view state. */ class FreshRSS_Context { - public static $conf = null; + public static $user_conf = null; + public static $system_conf = null; public static $categories = array(); public static $name = ''; @@ -37,17 +38,12 @@ class FreshRSS_Context { /** * Initialize the context. * - * Set the correct $conf and $categories variables. + * Set the correct configurations and $categories variables. */ public static function init() { // Init configuration. - $current_user = Minz_Session::param('currentUser'); - try { - self::$conf = new FreshRSS_Configuration($current_user); - } catch(Minz_Exception $e) { - Minz_Log::error('Cannot load configuration file of user `' . $current_user . '`'); - die($e->getMessage()); - } + self::$system_conf = Minz_Configuration::get('system'); + self::$user_conf = Minz_Configuration::get('user'); $catDAO = new FreshRSS_CategoryDAO(); self::$categories = $catDAO->listCategories(); @@ -198,7 +194,7 @@ class FreshRSS_Context { // By default, $next_get == $get self::$next_get = $get; - if (self::$conf->onread_jump_next && strlen($get) > 2) { + if (self::$user_conf->onread_jump_next && strlen($get) > 2) { $another_unread_id = ''; $found_current_get = false; switch ($get[0]) { @@ -276,7 +272,7 @@ class FreshRSS_Context { * @return boolean */ public static function isAutoRemoveAvailable() { - if (!self::$conf->auto_remove_article) { + if (!self::$user_conf->auto_remove_article) { return false; } if (self::isStateEnabled(FreshRSS_Entry::STATE_READ)) { @@ -297,7 +293,7 @@ class FreshRSS_Context { * @return boolean */ public static function isStickyPostEnabled() { - if (self::$conf->sticky_post) { + if (self::$user_conf->sticky_post) { return true; } if (self::isAutoRemoveAvailable()) { |
