Added search bar to header.

This commit is contained in:
2018-06-15 23:41:25 +02:00
committed by Stefan Rohde-Enslin
parent 916eddc099
commit 2ae4196546
5 changed files with 61 additions and 14 deletions

View File

@ -399,6 +399,10 @@ function searchMDObjects(array $arguments, array $settings):string {
$i = 0;
$lastToDisplay = end($toDisplay);
// Display option to go to start
if (!in_array(0, $toDisplay)) $output .= '<a href="search.php?startwert=0' . write_get_vars(['q', 'id']) . '#mdSearchObjs">1</a>';
while ($i < $contents[0]['total']) {
if (!in_array($i, $toDisplay)) {
@ -408,13 +412,17 @@ function searchMDObjects(array $arguments, array $settings):string {
$output .= '
<a ';
if ($i == $current) $output .= ' class="navicurrent"';
$output .= ' href="search.php?startwert=' . (string)$i . write_get_vars(['q', 'id']) . '#mdSearchObjs">' . strval($i / 24) . '</a>
$output .= ' href="search.php?startwert=' . (string)$i . write_get_vars(['q', 'id']) . '#mdSearchObjs">' . strval(($i / 24) + 1) . '</a>
';
$i += 24;
if ($i == $lastToDisplay) break;
}
// Display option to go to start
$last = $contents[0]["total"] - ($contents[0]["total"] % 24);
if (!in_array($last, $toDisplay)) $output .= '<a href="search.php?startwert=' . (string)$last . write_get_vars(['q', 'id']) . '#mdSearchObjs">' . (string)(($last / 24) + 1) . '</a>';
// Generate pagination
$output .= '