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

@ -28,15 +28,15 @@ function printPublicHead(array $settings, string $page = "home", string $title =
<meta http-equiv="Content-Security-Policy" content="default-src \'none\'; script-src \'self\'; connect-src \'self\' ' . $settings['mdVersion'] . '; img-src \'self\' ' . $settings['mdVersion'] . '; style-src \'self\' \'unsafe-inline\'; font-src \'self\';" />
<title>' . $title . '</title>
<link rel="stylesheet" type="text/css" href="themes/default/default.css">
<link rel="stylesheet" type="text/css" href="themes/imports.css">
<meta http-equiv="content-type" content="text/html;charset=utf-8">';
<link rel="stylesheet" type="text/css" href="themes/default/default.css" />
<link rel="stylesheet" type="text/css" href="themes/imports.css" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />';
$output .= $additional;
if ($icon) {
$output .= '
<link rel="shortcut icon" sizes="16x16 32x32" href="' . $icon . '" />
<link rel="shortcut icon" href="' . $icon . '" />
';
}
@ -74,6 +74,8 @@ function printPublicHeader(string $title = "Home"):string {
<h1>' . $title . '</h1>
' . generateSearchBar() . '
</header>
';
@ -190,4 +192,21 @@ function generatePublicNav($pages):string {
return $output;
}
/**
* Function for printing the search bar.
*
* @return string
*/
function generateSearchBar():string {
$output = '
<form action="search.php" method="GET">
<input type="search" name="q" />
</form>
';
return $output;
}
?>