aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-01 10:19:38 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-01 10:19:38 +0200
commitfdb63fbbe695b6a6bc32f0e93f2ff702ca42329c (patch)
tree0fcda9472b62c200438eb79c824f354735fcbb8a
parent7481887db746fd2d6eefab021776b8abd4076429 (diff)
Simplify configureController
Remove useless code for category configuration. See https://github.com/marienfressinaud/FreshRSS/issues/646
-rwxr-xr-xapp/Controllers/configureController.php33
-rw-r--r--app/views/configure/categorize.phtml2
2 files changed, 2 insertions, 33 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index dd7a0a441..3fd1d5149 100755
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -28,43 +28,12 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
* This action handles the category configuration page
*
* It displays the category configuration page.
- * If this action is reached through a POST request, it loops through
- * every category to check for modification then add a new category if
- * needed then sends a notification to the user.
- * If a category name is emptied, the category is deleted and all
- * related feeds are moved to the default category. Related user queries
- * are deleted too.
- * If a category name is changed, it is updated.
*/
public function categorizeAction() {
- $feedDAO = FreshRSS_Factory::createFeedDao();
$catDAO = new FreshRSS_CategoryDAO();
- $defaultCategory = $catDAO->getDefault();
- $defaultId = $defaultCategory->id();
-
- if (Minz_Request::isPost()) {
- $cats = Minz_Request::param('categories', array());
- $ids = Minz_Request::param('ids', array());
-
- foreach ($cats as $key => $name) {
- if (strlen($name) > 0) {
- $cat = new FreshRSS_Category($name);
- $values = array(
- 'name' => $cat->name(),
- );
- $catDAO->updateCategory($ids[$key], $values);
- }
- }
-
- invalidateHttpCache();
-
- Minz_Request::good(_t('categories_updated'),
- array('c' => 'configure', 'a' => 'categorize'));
- }
$this->view->categories = $catDAO->listCategories(false);
- $this->view->defaultCategory = $catDAO->getDefault();
- $this->view->feeds = $feedDAO->listFeeds();
+ $this->view->default_category = $catDAO->getDefault();
Minz_View::prependTitle(_t('categories_management') . ' ยท ');
}
diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml
index 008dc8c98..f5030ef2c 100644
--- a/app/views/configure/categorize.phtml
+++ b/app/views/configure/categorize.phtml
@@ -6,7 +6,7 @@
<h2><?php echo _t('categories_management'); ?></h2>
<p class="alert alert-warn">
- <?php echo _t('feeds_moved_category_deleted', $this->defaultCategory->name()); ?>
+ <?php echo _t('feeds_moved_category_deleted', $this->default_category->name()); ?>
</p>
<div class="box">