2 $body = ob_get_clean();
4 include_once './head.inc.php';
10 $nav = preg_replace_callback('{<a href="([^"]+)">(.*?)</a>}', function ($m) {
11 $request = $_SERVER['REQUEST_URI'];
12 $html = $request == $m[1] ? $m[2] : $m[0]; # text or full link
13 return $m[1] == substr($request, 0, strlen($m[1])) ? "<b>$html</b>" : $html;
16 $nav = preg_replace('{\s*<li class="logout">.*?</li>}', '', $nav);
17 $nav = str_replace('[[login]]', $User['name'], $nav);
20 $nav = preg_replace('{\s*<li class="login">.*?</li>}', '', $nav);
23 print "</header>\n\n";
27 $footinc = realpath('footer.html'); # cwd lost during shutdown
28 register_shutdown_function(function () {
30 @include $GLOBALS['footinc'];
34 if (isset($User) and $User['admin']) {
35 print '<script src="//cdn.ckeditor.com/4.7.3/full-all/ckeditor.js"></script>'."\n";
36 print '<script src="/edit.js"></script>'."\n";
39 print "</body></html>\n";