summaryrefslogtreecommitdiff
path: root/app/controllers/entryController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-16 22:19:27 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-16 22:19:27 +0100
commit8c2b3bfc30caa22258b9569b8a228db0adc90618 (patch)
tree9d4ea433e309bf5bb7a2275f365dcc28bf14f8df /app/controllers/entryController.php
parent9daa4c14636ca6b70031344f812ac99947b3a2b0 (diff)
Fix bug #27 : le marquer comme lu s'adapte si on ne regarde qu'une catégorie ou qu'un flux
Diffstat (limited to 'app/controllers/entryController.php')
-rwxr-xr-xapp/controllers/entryController.php28
1 files changed, 21 insertions, 7 deletions
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 {