From fb57be5a5af3a2fb46b2dbf2b503ffe78eb5cf49 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 21 Oct 2012 18:47:57 +0200 Subject: First commit --- app/controllers/entryController.php | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 app/controllers/entryController.php (limited to 'app/controllers/entryController.php') diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php new file mode 100755 index 000000000..e180cc7f1 --- /dev/null +++ b/app/controllers/entryController.php @@ -0,0 +1,58 @@ +listNotReadEntries (); + } else { + $entry = $entryDAO->searchById ($id); + $entries = $entry !== false ? array ($entry) : array (); + } + + foreach ($entries as $entry) { + $values = array ( + 'is_read' => $is_read, + ); + + $entryDAO->updateEntry ($entry->id (), $values); + } + + Request::forward (array (), true); + } + + public function bookmarkAction () { + $id = Request::param ('id'); + $is_fav = Request::param ('is_favorite'); + + if ($is_fav) { + $is_fav = true; + } else { + $is_fav = false; + } + + $entryDAO = new EntryDAO (); + if ($id != false) { + $entry = $entryDAO->searchById ($id); + + if ($entry != false) { + $values = array ( + 'is_favorite' => $is_fav, + ); + + $entryDAO->updateEntry ($entry->id (), $values); + } + } + + Request::forward (array (), true); + } +} -- cgit v1.2.3