aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/layout/nav_menu.phtml7
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));