From 71617080e224b8d3a3397a27b78e1f509499431c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Thu, 18 Sep 2014 21:06:38 -0400 Subject: Refactor code for strict unread message display Before, when you choose the show unread message option and the hide categories and feeds options, the categories and feeds weren't hidden. Now it is working properly. Before, the unread filter icon was not selected with the previous way of using the constants. Now, the filter is highlighted when selected in strict mode. See #619 --- app/Models/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Models/Configuration.php') diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index f94d82402..ea1556cbb 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -147,7 +147,7 @@ class FreshRSS_Configuration { // left blank on purpose case FreshRSS_Entry::STATE_NOT_READ: // left blank on purpose - case FreshRSS_Entry::STATE_NOT_READ_STRICT: + case FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ: $this->data['default_view'] = $value; break; default: -- cgit v1.2.3 From 5a1baff9be7cf9fe3f59fe2a7dc34fbadacc1a99 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 13:28:09 +0200 Subject: Refactor removing query by get param See https://github.com/marienfressinaud/FreshRSS/issues/625 --- app/Controllers/configureController.php | 10 +--------- app/Models/Configuration.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'app/Models/Configuration.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index e6e9172e6..231865bd7 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -59,15 +59,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $catDAO->deleteCategory($ids[$key]); // Remove related queries. - $final_queries = array(); - $id_cat_in_query = 'c_' . $ids[$key]; - foreach ($this->view->conf->queries as $key => $query) { - if (empty($query['get']) || - $query['get'] !== $id_cat_in_query) { - $final_queries[$key] = $query; - } - } - $this->view->conf->_queries($final_queries); + $this->view->conf->remove_query_by_get('c_' . $ids[$key]); $this->view->conf->save(); } } diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index ea1556cbb..91d2ab846 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -124,6 +124,16 @@ class FreshRSS_Configuration { return $this->available_languages; } + public function remove_query_by_get($get) { + $final_queries = array(); + foreach ($this->queries as $key => $query) { + if (empty($query['get']) || $query['get'] !== $get) { + $final_queries[$key] = $query; + } + } + $this->_queries($final_queries); + } + public function _language($value) { if (!isset($this->available_languages[$value])) { $value = 'en'; -- cgit v1.2.3