<?php
-$body = getoutput(@$Place);
-
include_once 'head.inc.php';
print "<header>\n";
-ob_start();
-include 'menu.inc.html';
+$menu = new ArchiveArticle('menu.inc.html');
ob_start();
if ($User and property_exists($User, 'login') and $User->login) {
print '<div class="login"><p>';
'<span class="icon icon-user">👤</span>',
'/login', $User->login
);
- if ($User->admin("edit {$Page->link}")) {
- $editpage = $Page->link;
- if (is_dir($editpage)) {
- if (file_exists("$editpage/index.html")) {
- $editpage .= '/index.html';
- }
- }
- else {
- $editpage .= '.html';
- }
- if (!file_exists($editpage) or is_writable($editpage)) {
- print ' <a class="icon icon-edit" href="#edit" title="wijzig">✍</a>';
- }
- }
print "</p></div>\n";
}
-$nav = getoutput(['login' => ob_get_clean()]);
+$menu->place['login'] = ob_get_clean();
+$nav = $menu->render();
$nav = preg_replace_callback('{<a href="([^"]+)">(.*?)</a>}', function ($m) {
$request = $_SERVER['REQUEST_URI'];
print $nav;
print "</header>\n\n";
-print $body;
-
register_shutdown_function(function () {
print '<footer>';
@include 'footer.inc.html';
print "</footer>\n";
-
- global $User, $Page;
- if ($User and $User->admin("edit {$Page->link}")) {
- $ckesrc = '/lib/ckeditor'; # local install
- if (!file_exists(DOCROOT . $ckesrc)) {
- $ckesrc = '//cdn.ckeditor.com/4.15.1/full-all'; # remote fallback
- }
- printf("<script>var ckesrc = '%s'</script>\n", "$ckesrc/ckeditor.js");
- print '<script src="/edit/page.js"></script>'."\n";
- }
-
print "</body></html>\n";
});