summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapp/Controllers/configureController.php10
-rw-r--r--app/Models/Configuration.php10
2 files changed, 11 insertions, 9 deletions
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';