From f80f775dfbe12cf6b95bda38b73f5dc37327d7fa Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Thu, 26 Jul 2018 15:09:50 +0100 Subject: Change the "private file" prefix from "@" to "_" It has all the benefits previously mentioned in commit 2f547251, as well as mirroring the common programming convention of using a "_" prefix to identify private variables/functions Hides files beginning with _ from mod_autoindex listings As well as 404ing on files starting with "_", also 404 on files starting with ".", as these are also private. Except for /.well-known/, because that's... well known, and should be public. --- html/_include.php | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 html/_include.php (limited to 'html/_include.php') diff --git a/html/_include.php b/html/_include.php new file mode 100644 index 0000000..7ce79b0 --- /dev/null +++ b/html/_include.php @@ -0,0 +1,66 @@ + elements for the site +function site_head($title) { + return "{$title}\n" + . "\n" + . "\n" + . "\n" + . "\n"; +} + +/// Get a single top-level navigation item for the site +function site_navitem($url, $text, $hide = false) { + $selected = $url == $_SERVER['REQUEST_URI']; + + $classes = []; + if ($selected) { + $classes[] = "selected"; + } + if ($hide && !$selected) { + $classes[] = "hidden"; + } + $classes = count($classes) > 0 ? (" class=\"" . implode(" ", $classes) . "\"") : ""; + + return "{$text}"; +} + +/// Get the standard page header elements for the site +function site_header($title) { + return "

{$title}

\n" + . "\n"; +} + +/// Get the standard page footer elements for the site +function site_footer() { + return "
\n" + . "

Spragg Software Services Ltd is registered in England, No. 11248242.\n" + . " Registered office: 82 Upper Hanover Street, Sheffield, S3 7RQ.\n" + . " VAT reg No. 295343283.

\n"; +} + +?> -- cgit v1.2.1