Add version to page header
This commit is contained in:
@@ -43,7 +43,14 @@ function add_info(string $message): void {
|
||||
* @param string $title The title of the page being displayed
|
||||
*/
|
||||
function page_head(string $title): void {
|
||||
?><!DOCTYPE html>
|
||||
if (str_ends_with(FRC_VERSION, '.0.0')) {
|
||||
$version = substr(FRC_VERSION, 0, strlen(FRC_VERSION) - 4);
|
||||
} elseif (str_ends_with(FRC_VERSION, '.0')) {
|
||||
$version = substr(FRC_VERSION, 0, strlen(FRC_VERSION) - 2);
|
||||
} else {
|
||||
$version = FRC_VERSION;
|
||||
} ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang=en>
|
||||
<head>
|
||||
<meta name=viewport content="width=device-width, initial-scale=1">
|
||||
@@ -52,7 +59,7 @@ function page_head(string $title): void {
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a class=title href="/">Feed Reader Central</a>
|
||||
<div><a class=title href="/">Feed Reader Central</a><span class=version>v<?=$version?></span></div>
|
||||
<div><?php
|
||||
if (array_key_exists(Key::USER_ID, $_SESSION)) {
|
||||
echo '<a href=/feed?id=new>Add Feed</a> | <a href=/user/log-off>Log Off</a>';
|
||||
@@ -75,7 +82,7 @@ function page_head(string $title): void {
|
||||
* Render the end of the page
|
||||
*/
|
||||
function page_foot(): void {
|
||||
?></main></body></html><?php
|
||||
echo '</main></body></html>';
|
||||
session_commit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user