aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-22 19:19:15 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-22 19:19:15 +0200
commit1fe5ed5d210334a051c48442fad29a14e8aee155 (patch)
tree985b9b3d364f8e6443434826d363f62c7ebcc0e7 /app/Controllers
parent8a6ad05ebacb6bf6c0f6afd0afe54a29a0a18ee9 (diff)
nextGet and idMax are coming back.
See https://github.com/marienfressinaud/FreshRSS/issues/634
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/entryController.php14
-rwxr-xr-xapp/Controllers/indexController.php15
2 files changed, 17 insertions, 12 deletions
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index 449029648..d11f3a520 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -17,14 +17,6 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
);
}
- // Keep parameter information (output) to do a correct redirection at
- // the end.
- $this->params = array();
- $output = Minz_Request::param('output', '');
- if ($output != '' && FreshRSS_Context::$conf->view_mode !== $output) {
- $this->params['output'] = $output;
- }
-
// If ajax request, we do not print layout
$this->ajax = Minz_Request::param('ajax');
if ($this->ajax) {
@@ -53,6 +45,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);
+ $params = array();
$entryDAO = FreshRSS_Factory::createEntryDao();
if ($id === false) {
@@ -86,7 +79,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
// Redirect to the correct page (category, feed or starred)
// Not "a" because it is the default value if nothing is
// given.
- $this->params['get'] = $next_get;
+ $params['get'] = $next_get;
}
}
} else {
@@ -98,7 +91,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
Minz_Request::good(_t('feeds_marked_read'), array(
'c' => 'index',
'a' => 'index',
- 'params' => $this->params,
+ 'params' => $params,
), true);
}
}
@@ -123,7 +116,6 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
Minz_Request::forward(array(
'c' => 'index',
'a' => 'index',
- 'params' => $this->params,
), true);
}
}
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 2dd4c3068..80675b3a6 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -34,12 +34,25 @@ class FreshRSS_index_Controller extends Minz_ActionController {
try {
$entries = $this->listEntriesByContext();
- if (count($entries) > FreshRSS_Context::$number) {
+ $nb_entries = count($entries);
+ if ($nb_entries > FreshRSS_Context::$number) {
// We have more elements for pagination
$last_entry = array_pop($entries);
FreshRSS_Context::$next_id = $last_entry->id();
}
+ $first_entry = $nb_entries > 0 ? $entries[0] : null;
+ FreshRSS_Context::$id_max = $first_entry === null ?
+ (time() - 1) . '000000' :
+ $first_entry->id();
+ if (FreshRSS_Context::$order === 'ASC') {
+ // In this case we do not know but we guess id_max
+ $id_max = (time() - 1) . '000000';
+ if (strcmp($id_max, FreshRSS_Context::$id_max) > 0) {
+ FreshRSS_Context::$id_max = $id_max;
+ }
+ }
+
$this->view->entries = $entries;
} catch (FreshRSS_EntriesGetter_Exception $e) {
Minz_Log::notice($e->getMessage());