Beispiel #1
0
 public function deleteAction()
 {
     if (Minz_Request::isPost()) {
         $type = Minz_Request::param('type', 'feed');
         $id = Minz_Request::param('id');
         $feedDAO = new FreshRSS_FeedDAO();
         if ($type == 'category') {
             if ($feedDAO->deleteFeedByCategory($id)) {
                 $notif = array('type' => 'good', 'content' => Minz_Translate::t('category_emptied'));
                 //TODO: Delete old favicons
             } else {
                 $notif = array('type' => 'bad', 'content' => Minz_Translate::t('error_occured'));
             }
         } else {
             if ($feedDAO->deleteFeed($id)) {
                 $notif = array('type' => 'good', 'content' => Minz_Translate::t('feed_deleted'));
                 //TODO: Delete old favicon
             } else {
                 $notif = array('type' => 'bad', 'content' => Minz_Translate::t('error_occured'));
             }
         }
         Minz_Session::_param('notification', $notif);
         if ($type == 'category') {
             Minz_Request::forward(array('c' => 'configure', 'a' => 'categorize'), true);
         } else {
             Minz_Request::forward(array('c' => 'configure', 'a' => 'feed'), true);
         }
     }
 }