diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index e509d70a..578e08cd 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -274,43 +274,46 @@ class lamList { printf($this->labels['nav'], $count); echo(""); - echo("type . "nav-activepage\" align=\"right\">"); - if ($this->page != 1) { - echo("type . "&norefresh=true&page=1" . - "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . - "\"\"\n"); - } - if ($this->page > 10) { - echo("type . "&norefresh=true&page=" . ($this->page - 10) . - "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . - "\"\"\n"); - } - for ($i = $this->page - 5; $i < ($this->page + 4); $i++) { - if ($i >= ($count / $this->maxPageEntries)) { - break; + if ($count > $this->maxPageEntries) { + echo("type . "nav-activepage\" align=\"right\">"); + if ($this->page != 1) { + echo("type . "&norefresh=true&page=1" . + "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . + "\"\"\n"); } - elseif ($i < 0) { - continue; + if ($this->page > 10) { + echo("type . "&norefresh=true&page=" . ($this->page - 10) . + "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . + "\"\"\n"); } - if ($i == $this->page - 1) { - echo(" " . ($i + 1)); + for ($i = $this->page - 5; $i < ($this->page + 4); $i++) { + if ($i >= ($count / $this->maxPageEntries)) { + break; + } + elseif ($i < 0) { + continue; + } + if ($i == $this->page - 1) { + echo(" " . ($i + 1)); + } + else { + echo(" type . "&norefresh=true&page=" . ($i + 1) . + "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . ($i + 1) . "\n"); + } } - else { - echo(" type . "&norefresh=true&page=" . ($i + 1) . - "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . ($i + 1) . "\n"); + if ($this->page < (($count / $this->maxPageEntries) - 10)) { + echo("type . "&norefresh=true&page=" . ($this->page + 10) . + "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . + "\"\"\n"); } + if ($this->page < ($count / $this->maxPageEntries)) { + echo("type . "&norefresh=true&page=" . round(($count / $this->maxPageEntries)) . + "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . + "\"\"\n"); + } + echo ""; } - if ($this->page < (($count / $this->maxPageEntries) - 10)) { - echo("type . "&norefresh=true&page=" . ($this->page + 10) . - "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . - "\"\"\n"); - } - if ($this->page < ($count / $this->maxPageEntries)) { - echo("type . "&norefresh=true&page=" . round(($count / $this->maxPageEntries)) . - "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . - "\"\"\n"); - } - echo("\n"); + echo "\n"; } /**