summaryrefslogtreecommitdiff
path: root/app/controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-04-17 19:05:53 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-04-17 19:05:53 +0200
commit392672ab2771c6d22f55017c4ed64a0e00945b23 (patch)
tree087ae495e38551392c94d942a4b6f32a7ebae015 /app/controllers/feedController.php
parent6ce2b575eb501733e6936ac4b5f2e70d0f6ca13b (diff)
Fix issue #58 : possibilité de vider une catégorie
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);
+ }
}
}