Changeset:
226b9bca3de5
https://sourceforge.net/p/mrbs/hg-code/ci/226b9bca3de5208d1bd6a1474f65a1f81e239703
Author:
Campbell Morrison <[email protected]>
Date:
Sun Oct 02 15:23:25 2016 +0100
Log message:
Simplified print_simple_header()
diffstat:
web/Themes/default/header.inc | 21 ++++++++++++++-------
web/functions.inc | 22 +---------------------
2 files changed, 15 insertions(+), 28 deletions(-)
diffs (92 lines):
diff -r 433abc12af56 -r 226b9bca3de5 web/Themes/default/header.inc
--- a/web/Themes/default/header.inc Sun Oct 02 15:12:18 2016 +0100
+++ b/web/Themes/default/header.inc Sun Oct 02 15:23:25 2016 +0100
@@ -4,14 +4,18 @@
// $Id$
-function print_head()
+function print_head($simple=false)
{
echo "<head>\n";
echo "<meta charset=\"" . get_charset() . "\">\n";
echo "<title>" . get_vocab("mrbs") . "</title>\n";
require_once "style.inc";
- require_once "js.inc";
+
+ if (!$simple)
+ {
+ require_once "js.inc";
+ }
echo "</head>\n";
}
@@ -203,7 +207,7 @@
// Print the page header
// If $simple is true, then just print a simple header that doesn't require
any database
-// access (useful for fatal errors and database upgrades).
+// access or JavaScript (useful for fatal errors and database upgrades).
function print_theme_header($day, $month, $year, $area, $room, $simple=false)
{
global $search_str, $locale_warning;
@@ -233,7 +237,7 @@
echo "<html>\n";
- print_head();
+ print_head($simple);
// Put the filename in as a class to aid styling.
// (Use a class rather than id to avoid specificity problems)
@@ -262,11 +266,14 @@
print_nav($day, $month, $year, $area, $room, $search_str);
}
echo "</header>\n";
-?>
+ if (!$simple)
+ {
+ // This <div> should really be moved out of here so that we can always see
+ // the matching closing </div>
+ echo "<div id=\"contents\">\n";
+ }
-<div id="contents">
-<?php
} // end of print_theme_header()
diff -r 433abc12af56 -r 226b9bca3de5 web/functions.inc
--- a/web/functions.inc Sun Oct 02 15:12:18 2016 +0100
+++ b/web/functions.inc Sun Oct 02 15:23:25 2016 +0100
@@ -123,27 +123,7 @@
// header uses are not yet available.
function print_simple_header()
{
- global $done_header;
-
- if ($done_header)
- {
- return;
- }
-
- http_headers();
- echo DOCTYPE;
- ?>
-
-<html>
- <head>
- <?php
- require_once "style.inc";
- ?>
- <title><?php echo get_vocab("mrbs") ?></title>
- </head>
- <body>
- <?php
- $done_header = TRUE;
+ print_header($day=null, $month=null, $year=null, $area=null, $room=null,
$simple=true);
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits