2 $body = getoutput(@$Place);
4 include_once 'head.inc.php';
8 include 'menu.inc.html';
10 if ($User and property_exists($User, 'login') and $User->login) {
11 print '<div class="login"><p>';
12 printf('<span title="ingelogd">%s <a href="%s">%s</a></span>',
13 '<span class="icon icon-user">👤</span>',
14 '/login', $User->login
16 if ($User->admin("edit $Page$Args")) {
17 $editpage = $Page.$Args;
18 if (is_dir($editpage)) {
19 if (file_exists("$editpage/index.html")) {
20 $editpage .= '/index.html';
26 if (!file_exists($editpage) or is_writable($editpage)) {
27 print ' <a class="icon icon-edit" href="#edit" title="wijzig">✍</a>';
32 $nav = getoutput(['login' => ob_get_clean()]);
34 $nav = preg_replace_callback('{<a href="([^"]+)">(.*?)</a>}', function ($m) {
35 $request = $_SERVER['REQUEST_URI'];
36 $html = $request == $m[1] ? $m[2] : $m[0]; # text or full link
37 return $m[1] == substr($request, 0, strlen($m[1])) ? "<b>$html</b>" : $html;
40 print "</header>\n\n";
44 register_shutdown_function(function () {
46 @include 'footer.inc.html';
49 global $User, $Page, $Args;
50 if ($User and $User->admin("edit $Page$Args")) {
51 $ckesrc = '/lib/ckeditor'; # local install
52 if (!file_exists(DOCROOT . $ckesrc)) {
53 $ckesrc = '//cdn.ckeditor.com/4.15.1/full-all'; # remote fallback
55 printf("<script>var ckesrc = '%s'</script>\n", "$ckesrc/ckeditor.js");
56 print '<script src="/edit/page.js"></script>'."\n";
59 print "</body></html>\n";