X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/772961fd4e9be46ad340cad1e55ee5f28cc5b968..aee71926fef0a65076c0c40b4c3280506dec5aba:/page.inc.php diff --git a/page.inc.php b/page.inc.php index 137d266..17e7c80 100644 --- a/page.inc.php +++ b/page.inc.php @@ -1,11 +1,19 @@ 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("\n", "$ckesrc/ckeditor.js"); + print ''."\n"; + $Page->head = ob_get_clean(); +} include_once 'head.inc.php'; print "
\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 '

'; @@ -29,7 +37,8 @@ if ($User and property_exists($User, 'login') and $User->login) { } print "

\n"; } -$nav = getoutput(['login' => ob_get_clean()]); +$menu->place['login'] = ob_get_clean(); +$nav = $menu->render(); $nav = preg_replace_callback('{(.*?)}', function ($m) { $request = $_SERVER['REQUEST_URI']; @@ -39,23 +48,12 @@ $nav = preg_replace_callback('{(.*?)}', function ($m) { print $nav; print "
\n\n"; -print $body; +print $Page->render(); register_shutdown_function(function () { print '\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("\n", "$ckesrc/ckeditor.js"); - print ''."\n"; - } - print "\n"; });