2 $body = getoutput(@$Place);
4 include_once 'head.inc.php';
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 'footer.html';
53 if (!empty($User['admin'])) {
54 $ckesrc = '/lib/ckeditor'; # local install
55 if (!file_exists(DOCROOT . $ckesrc)) {
56 $ckesrc = '//cdn.ckeditor.com/4.7.3/full-all'; # remote fallback
58 printf('<script src="%s"></script>'."\n", "$ckesrc/ckeditor.js");
59 print '<script src="/edit/page.js"></script>'."\n";
62 print "</body></html>\n";