2 $body = getoutput($Place);
4 include_once DOCROOT.'head.inc.php';
8 include DOCROOT.'menu.html';
11 print '<div class="login"><p>';
12 printf('<span>Ingelogd: <b><a href="%s">%s</a></b></span>', '/login', $User['name']);
13 if (!empty($User['admin'])) {
14 $editpage = $Page.$Args;
15 if (is_dir($editpage)) {
16 if (file_exists("$editpage/index.html")) {
17 $editpage .= '/index.html';
23 if (!file_exists($editpage) or is_writable($editpage)) {
24 print ' <a href="#edit">Wijzig</a>';
29 $nav = getoutput(['login' => ob_get_clean()]);
31 $nav = preg_replace_callback('{<a href="([^"]+)">(.*?)</a>}', function ($m) {
32 $request = $_SERVER['REQUEST_URI'];
33 $html = $request == $m[1] ? $m[2] : $m[0]; # text or full link
34 return $m[1] == substr($request, 0, strlen($m[1])) ? "<b>$html</b>" : $html;
37 $nav = preg_replace('{\s*<li class="logout">.*?</li>}', '', $nav);
40 $nav = preg_replace('{\s*<li class="login">.*?</li>}', '', $nav);
43 print "</header>\n\n";
47 register_shutdown_function(function () {
49 @include DOCROOT.'footer.html';
53 if (!empty($User['admin'])) {
54 print '<script src="//cdn.ckeditor.com/4.7.3/full-all/ckeditor.js"></script>'."\n";
55 print '<script src="/edit.js"></script>'."\n";
58 print "</body></html>\n";