summaryrefslogtreecommitdiff
path: root/src/template.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/template.php')
-rw-r--r--src/template.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/template.php b/src/template.php
index 6e2ad0c..ca781b9 100644
--- a/src/template.php
+++ b/src/template.php
@@ -1,9 +1,14 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+<?php
+
+$nav = fn(string $ln) =>
+ (($params["active-link"] ?? null) === $ln) ? ' active' : '';
+
+?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
- <title><?= htmlentities($title) ?></title>
+ <title><?= htmlentities($params["title"] ?? "") ?></title>
<link rel="stylesheet" href="/static/style.css" type="text/css" />
</head>
<body>
@@ -27,7 +32,7 @@
<table id="navLayout" cellspacing="0">
<tbody>
<tr>
- <td class="navCell" style="border-left:0">
+ <td class="navCell<?= $nav("home") ?>" style="border-left:0">
<a href="/"><img
class="navIcon"
alt=""
@@ -36,7 +41,7 @@
src="/static/icons/home.gif"
/>&nbsp;Home page</a>
</td>
- <td class="navCell">
+ <td class="navCell<?= $nav("about") ?>">
<a href="/about"><img
class="navIcon"
alt=""