From 8c2b3bfc30caa22258b9569b8a228db0adc90618 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 16 Mar 2013 22:19:27 +0100 Subject: Fix bug #27 : le marquer comme lu s'adapte si on ne regarde qu'une catégorie ou qu'un flux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/entryController.php | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'app/controllers/entryController.php') diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php index ca702191f..cb309c567 100755 --- a/app/controllers/entryController.php +++ b/app/controllers/entryController.php @@ -17,7 +17,11 @@ class entryController extends ActionController { public function lastAction () { $ajax = Request::param ('ajax'); if (!$ajax) { - Request::forward (array (), true); + Request::forward (array ( + 'c' => 'index', + 'a' => 'index', + 'params' => $this->params + ), true); } else { Request::_param ('ajax'); } @@ -26,6 +30,7 @@ class entryController extends ActionController { public function readAction () { $id = Request::param ('id'); $is_read = Request::param ('is_read'); + $get = Request::param ('get'); if ($is_read) { $is_read = true; @@ -33,18 +38,27 @@ class entryController extends ActionController { $is_read = false; } - $values = array ( - 'is_read' => $is_read, - ); - $entryDAO = new EntryDAO (); if ($id == false) { - $entryDAO->updateEntries ($values); + if (!$get) { + $entryDAO->markReadEntries ($is_read); + } else { + $typeGet = $get[0]; + $get = substr ($get, 2); + + if ($typeGet == 'c') { + $entryDAO->markReadCat ($get, $is_read); + $this->params = array ('get' => 'c_' . $get); + } elseif ($typeGet == 'f') { + $entryDAO->markReadFeed ($get, $is_read); + $this->params = array ('get' => 'f_' . $get); + } + } // notif $notif = array ( 'type' => 'good', - 'content' => 'Tous les flux ont été marqués comme lu' + 'content' => 'Les flux ont été marqués comme lu' ); Session::_param ('notification', $notif); } else { -- cgit v1.2.3