From a4beb7b772fdc3c8c894b93611bfb030c9456f07 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 13 Apr 2013 14:26:13 +0200 Subject: Correction faute dans about + ajout options mise à jour et marquer comme lu pour un flux spécifiée MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 3e6ae4800..d2a2184eb 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -97,7 +97,16 @@ class feedController extends ActionController { $feedDAO = new FeedDAO (); $entryDAO = new EntryDAO (); - $feeds = $feedDAO->listFeedsOrderUpdate (); + $id = Request::param ('id'); + $feeds = array (); + if ($id) { + $feed = $feedDAO->searchById ($id); + if ($feed) { + $feeds = array ($feed); + } + } else { + $feeds = $feedDAO->listFeedsOrderUpdate (); + } // pour ne pas ajouter des entrées trop anciennes $nb_month_old = $this->view->conf->oldEntries (); @@ -130,10 +139,23 @@ class feedController extends ActionController { $entryDAO->cleanOldEntries ($nb_month_old); // notif - $notif = array ( - 'type' => 'good', - 'content' => $i . ' flux ont été mis à jour' - ); + if ($i == 1) { + $feed = reset ($feeds); + $notif = array ( + 'type' => 'good', + 'content' => '' . $feed->name () . ' a été mis à jour' + ); + } elseif ($i > 0) { + $notif = array ( + 'type' => 'good', + 'content' => $i . ' flux ont été mis à jour' + ); + } else { + $notif = array ( + 'type' => 'bad', + 'content' => 'Aucun flux n\'a pu être mis à jour' + ); + } Session::_param ('notification', $notif); Request::forward (array (), true); -- cgit v1.2.3