X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/c5d71935bf920cae82c602ff3d644d2e4bb6df47..4e1394082f1446017534b9c3d423a35d483da6ab:/page.inc.php diff --git a/page.inc.php b/page.inc.php index 0ca6589..654f37f 100644 --- a/page.inc.php +++ b/page.inc.php @@ -1,28 +1,41 @@ \n"; ob_start(); -include 'menu.html'; +include './menu.html'; $nav = ob_get_clean(); $nav = preg_replace_callback('{(.*?)}', function ($m) { $request = $_SERVER['REQUEST_URI']; $html = $request == $m[1] ? $m[2] : $m[0]; # text or full link return $m[1] == substr($request, 0, strlen($m[1])) ? "$html" : $html; }, $nav); +if (isset($User)) { + $nav = preg_replace('{\s*
  • .*?
  • }', '', $nav); + $nav = str_replace('[[login]]', $User['name'], $nav); +} +else { + $nav = preg_replace('{\s*
  • .*?
  • }', '', $nav); +} print $nav; print "\n\n"; -print '
    '."\n\n"; - -include_once 'auth.inc.php'; +print $body; +$footinc = realpath('footer.html'); # cwd lost during shutdown register_shutdown_function(function () { - print "
    \n\n"; - include 'foot.inc.php'; + print '\n"; + + global $User; + if (isset($User) and $User['admin']) { + print ''."\n"; + print ''."\n"; + } + print "\n"; }); -include "$Page.html"; -if (file_exists("$Page.php")) include_once("$Page.php"); -