aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/entryController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-18 00:00:08 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-18 00:00:08 +0200
commit32c734ef622f4ed83d212d3eb1d15d83d406bd86 (patch)
treecde0d769670fad9820a51ffbef1090c79303be43 /app/Controllers/entryController.php
parentaef1d2a774599b46bb98238f0acdff5287b1ad8e (diff)
SQL mark search as read
https://github.com/FreshRSS/FreshRSS/issues/608
Diffstat (limited to 'app/Controllers/entryController.php')
-rwxr-xr-xapp/Controllers/entryController.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index bff1073ef..c40588105 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -40,6 +40,17 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
$get = Minz_Request::param('get');
$next_get = Minz_Request::param('nextGet', $get);
$id_max = Minz_Request::param('idMax', 0);
+ FreshRSS_Context::$search = new FreshRSS_Search(Minz_Request::param('search', ''));
+
+ FreshRSS_Context::$state = Minz_Request::param('state', 0);
+ if (FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_FAVORITE)) {
+ FreshRSS_Context::$state = FreshRSS_Entry::STATE_FAVORITE;
+ } elseif (FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_FAVORITE)) {
+ FreshRSS_Context::$state = FreshRSS_Entry::STATE_NOT_FAVORITE;
+ } else {
+ FreshRSS_Context::$state = 0;
+ }
+
$params = array();
$entryDAO = FreshRSS_Factory::createEntryDao();
@@ -58,16 +69,16 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
$get = substr($get, 2);
switch($type_get) {
case 'c':
- $entryDAO->markReadCat($get, $id_max);
+ $entryDAO->markReadCat($get, $id_max, FreshRSS_Context::$search, FreshRSS_Context::$state);
break;
case 'f':
- $entryDAO->markReadFeed($get, $id_max);
+ $entryDAO->markReadFeed($get, $id_max, FreshRSS_Context::$search, FreshRSS_Context::$state);
break;
case 's':
- $entryDAO->markReadEntries($id_max, true);
+ $entryDAO->markReadEntries($id_max, true, 0, FreshRSS_Context::$search);
break;
case 'a':
- $entryDAO->markReadEntries($id_max);
+ $entryDAO->markReadEntries($id_max, false, 0, FreshRSS_Context::$search, FreshRSS_Context::$state);
break;
}