aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/feedController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/feedController.php')
-rwxr-xr-xapp/controllers/feedController.php38
1 files changed, 31 insertions, 7 deletions
diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php
index fb0f790fd..7a34430ea 100755
--- a/app/controllers/feedController.php
+++ b/app/controllers/feedController.php
@@ -228,19 +228,43 @@ class feedController extends ActionController {
array ('error' => array ('Vous n\'avez pas le droit d\'accéder à cette page'))
);
} else {
+ $type = Request::param ('type', 'feed');
$id = Request::param ('id');
$feedDAO = new FeedDAO ();
- $feedDAO->deleteFeed ($id);
+ if ($type == 'category') {
+ if ($feedDAO->deleteFeedByCategory ($id)) {
+ $notif = array (
+ 'type' => 'good',
+ 'content' => 'La catégorie a été vidée'
+ );
+ } else {
+ $notif = array (
+ 'type' => 'bad',
+ 'content' => 'Un problème est survenu'
+ );
+ }
+ } else {
+ if ($feedDAO->deleteFeed ($id)) {
+ $notif = array (
+ 'type' => 'good',
+ 'content' => 'Le flux a été supprimé'
+ );
+ } else {
+ $notif = array (
+ 'type' => 'bad',
+ 'content' => 'Un problème est survenu'
+ );
+ }
+ }
- // notif
- $notif = array (
- 'type' => 'good',
- 'content' => 'Le flux a été supprimé'
- );
Session::_param ('notification', $notif);
- Request::forward (array ('c' => 'configure', 'a' => 'feed'), true);
+ if ($type == 'category') {
+ Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true);
+ } else {
+ Request::forward (array ('c' => 'configure', 'a' => 'feed'), true);
+ }
}
}