summaryrefslogtreecommitdiff
path: root/app/Models/Configuration.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-24 15:17:07 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-24 15:17:07 +0200
commit3e2d34c8671acae33568fdeb1398afad8296d9bf (patch)
tree6a8fa1430115d12e78855362e093dae9667008f8 /app/Models/Configuration.php
parent5d7d01be296a23058026e0dc610b2e2077b3262c (diff)
parent83d95ca4b894a84de467a97c7f413c1d04c43631 (diff)
Merge branch '634-refactor-with-context' into dev
Diffstat (limited to 'app/Models/Configuration.php')
-rw-r--r--app/Models/Configuration.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php
index 2f208e509..53f136513 100644
--- a/app/Models/Configuration.php
+++ b/app/Models/Configuration.php
@@ -14,7 +14,8 @@ class FreshRSS_Configuration {
'apiPasswordHash' => '', //CRYPT_BLOWFISH
'posts_per_page' => 20,
'view_mode' => 'normal',
- 'default_view' => FreshRSS_Entry::STATE_NOT_READ,
+ 'default_view' => 'adaptive',
+ 'default_state' => FreshRSS_Entry::STATE_NOT_READ,
'auto_load_more' => true,
'display_posts' => false,
'display_categories' => false,
@@ -153,18 +154,22 @@ class FreshRSS_Configuration {
}
public function _default_view($value) {
switch ($value) {
- case FreshRSS_Entry::STATE_ALL:
- // left blank on purpose
- case FreshRSS_Entry::STATE_NOT_READ:
- // left blank on purpose
- case FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ:
+ case 'all':
$this->data['default_view'] = $value;
+ $this->data['default_state'] = (FreshRSS_Entry::STATE_READ +
+ FreshRSS_Entry::STATE_NOT_READ);
break;
+ case 'adaptive':
+ case 'unread':
default:
- $this->data['default_view'] = FreshRSS_Entry::STATE_ALL;
- break;
+ $this->data['default_view'] = $value;
+ $this->data['default_state'] = FreshRSS_Entry::STATE_NOT_READ;
}
}
+ public function _default_state($value) {
+ $this->data['default_state'] = (int)$value;
+ }
+
public function _display_posts($value) {
$this->data['display_posts'] = ((bool)$value) && $value !== 'no';
}