hide navigation if only a single page exists
This commit is contained in:
parent
cea3fdd67b
commit
4227b01756
|
@ -274,43 +274,46 @@ class lamList {
|
|||
printf($this->labels['nav'], $count);
|
||||
echo("</td>");
|
||||
|
||||
echo("<td class=\"" . $this->type . "nav-activepage\" align=\"right\">");
|
||||
if ($this->page != 1) {
|
||||
echo("<a title=\"" . _('Jump to first page') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=1" .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
|
||||
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-first.png\"></a>\n");
|
||||
}
|
||||
if ($this->page > 10) {
|
||||
echo("<a title=\"" . _('Jump 10 pages backward') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($this->page - 10) .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
|
||||
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-previous.png\"></a>\n");
|
||||
}
|
||||
for ($i = $this->page - 5; $i < ($this->page + 4); $i++) {
|
||||
if ($i >= ($count / $this->maxPageEntries)) {
|
||||
break;
|
||||
if ($count > $this->maxPageEntries) {
|
||||
echo("<td class=\"" . $this->type . "nav-activepage\" align=\"right\">");
|
||||
if ($this->page != 1) {
|
||||
echo("<a title=\"" . _('Jump to first page') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=1" .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
|
||||
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-first.png\"></a>\n");
|
||||
}
|
||||
elseif ($i < 0) {
|
||||
continue;
|
||||
if ($this->page > 10) {
|
||||
echo("<a title=\"" . _('Jump 10 pages backward') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($this->page - 10) .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
|
||||
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-previous.png\"></a>\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(" <a href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($i + 1) .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . ($i + 1) . "</a>\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo(" <a href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($i + 1) .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . ($i + 1) . "</a>\n");
|
||||
if ($this->page < (($count / $this->maxPageEntries) - 10)) {
|
||||
echo("<a title=\"" . _('Jump 10 pages forward') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($this->page + 10) .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
|
||||
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-next.png\"></a>\n");
|
||||
}
|
||||
if ($this->page < ($count / $this->maxPageEntries)) {
|
||||
echo("<a title=\"" . _('Jump to last page') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . round(($count / $this->maxPageEntries)) .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
|
||||
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-last.png\"></a>\n");
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
if ($this->page < (($count / $this->maxPageEntries) - 10)) {
|
||||
echo("<a title=\"" . _('Jump 10 pages forward') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($this->page + 10) .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
|
||||
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-next.png\"></a>\n");
|
||||
}
|
||||
if ($this->page < ($count / $this->maxPageEntries)) {
|
||||
echo("<a title=\"" . _('Jump to last page') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . round(($count / $this->maxPageEntries)) .
|
||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
|
||||
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-last.png\"></a>\n");
|
||||
}
|
||||
echo("</td></tr></table>\n");
|
||||
echo "</tr></table>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue