summaryrefslogtreecommitdiff
path: root/app/Controllers/entryController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-09-03 20:48:04 +0200
committerGravatar GitHub <noreply@github.com> 2018-09-03 20:48:04 +0200
commitd3f5bd840d513bc4820a919ef9e0f02b0263ff9c (patch)
tree2fa5d1a5711c4e52603924e0740b7c820621617f /app/Controllers/entryController.php
parent14e1b23e42b322b9c54475e4b69c1aa60c94e280 (diff)
Add mark-as-unread (#1995)
* Add mark-as-unread https://github.com/FreshRSS/FreshRSS/issues/1966 * Change sentence https://github.com/FreshRSS/FreshRSS/pull/1995#discussion_r214515954 * Enable mark-as-unread only when unread articles are shown In order to prevent erroneous marking-as-unread. We might find a better logic later. * Disable instead of hide mark-as-unread option To make it easier to discover
Diffstat (limited to 'app/Controllers/entryController.php')
-rwxr-xr-xapp/Controllers/entryController.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index 838ad56ce..16a15c447 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -40,6 +40,7 @@ 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);
+ $is_read = (bool)(Minz_Request::param('is_read', true));
FreshRSS_Context::$search = new FreshRSS_BooleanSearch(Minz_Request::param('search', ''));
FreshRSS_Context::$state = Minz_Request::param('state', 0);
@@ -63,39 +64,38 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
if (!$get) {
// No get? Mark all entries as read (from $id_max)
- $entryDAO->markReadEntries($id_max);
+ $entryDAO->markReadEntries($id_max, $is_read);
} else {
$type_get = $get[0];
$get = substr($get, 2);
switch($type_get) {
case 'c':
- $entryDAO->markReadCat($get, $id_max, FreshRSS_Context::$search, FreshRSS_Context::$state);
+ $entryDAO->markReadCat($get, $id_max, FreshRSS_Context::$search, FreshRSS_Context::$state, $is_read);
break;
case 'f':
- $entryDAO->markReadFeed($get, $id_max, FreshRSS_Context::$search, FreshRSS_Context::$state);
+ $entryDAO->markReadFeed($get, $id_max, FreshRSS_Context::$search, FreshRSS_Context::$state, $is_read);
break;
case 's':
- $entryDAO->markReadEntries($id_max, true, 0, FreshRSS_Context::$search);
+ $entryDAO->markReadEntries($id_max, true, 0, FreshRSS_Context::$search, FreshRSS_Context::$state, $is_read);
break;
case 'a':
- $entryDAO->markReadEntries($id_max, false, 0, FreshRSS_Context::$search, FreshRSS_Context::$state);
+ $entryDAO->markReadEntries($id_max, false, 0, FreshRSS_Context::$search, FreshRSS_Context::$state, $is_read);
break;
}
if ($next_get !== 'a') {
// Redirect to the correct page (category, feed or starred)
- // Not "a" because it is the default value if nothing is
- // given.
+ // Not "a" because it is the default value if nothing is given.
$params['get'] = $next_get;
}
}
} else {
- $is_read = (bool)(Minz_Request::param('is_read', true));
$entryDAO->markRead($id, $is_read);
}
if (!$this->ajax) {
- Minz_Request::good(_t('feedback.sub.feed.marked_read'), array(
+ Minz_Request::good(_t($is_read ? 'feedback.sub.articles.marked_read' : 'feedback.sub.articles.marked_unread'),
+ array(
'c' => 'index',
'a' => 'index',
'params' => $params,