<?php
-$body = $Page->render();
+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
+ }
+ ob_start();
+ printf("<script>var ckesrc = '%s'</script>\n", "$ckesrc/ckeditor.js");
+ print '<script src="/edit/page.js"></script>'."\n";
+ $Page->head = ob_get_clean();
+}
include_once 'head.inc.php';
print "<header>\n";
-ob_start();
$menu = new ArchiveArticle('menu.inc.html');
-print $menu->raw;
ob_start();
if ($User and property_exists($User, 'login') and $User->login) {
print '<div class="login"><p>';
print $nav;
print "</header>\n\n";
-print $body;
+print $Page->render();
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";
});