diff options
| author | 2014-02-21 10:02:43 +0100 | |
|---|---|---|
| committer | 2014-02-21 10:02:43 +0100 | |
| commit | d7083803c371c1668c92e086b3bff6e8a7610bc5 (patch) | |
| tree | 0cf2f801113ade61a3ea658634b20c0796620c4c | |
| parent | 3dd6677421c9ba776f4734a890b4e7241c2faafb (diff) | |
Bug "mark all as read" when using DESC order
Solves https://github.com/marienfressinaud/FreshRSS/issues/431
| -rw-r--r-- | app/layout/nav_menu.phtml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 98064a6f7..24c0e38e9 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -61,7 +61,12 @@ break; } } - $p = isset($this->entries[0]) ? $this->entries[0] : null; + if ($this->order === 'ASC') { + $nb = count($this->entries) - 1; + $p = ($nb >= 0 && isset($this->entries[$nb])) ? $this->entries[$nb] : null; + } else { + $p = isset($this->entries[0]) ? $this->entries[0] : null; + } $idMax = $p === null ? '0' : $p->id(); $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('get' => $get, 'nextGet' => $nextGet, 'idMax' => $idMax)); |
