X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/9de683f8c399ee4a78fbc86b5ee96ce5662acf97..093b58d93d97ef29e579356f2486859476e99034:/page.inc.php?ds=sidebyside
diff --git a/page.inc.php b/page.inc.php
index b3fa5f7..577f1e0 100644
--- a/page.inc.php
+++ b/page.inc.php
@@ -1,10 +1,33 @@
\n";
ob_start();
-include './menu.html';
-$nav = ob_get_clean();
+include 'menu.inc.html';
+ob_start();
+if ($User) {
+ print '
';
+ printf('Ingelogd: %s', '/login', $User->login);
+ if ($User->admin('edit')) {
+ $editpage = $Page.$Args;
+ 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 ' Wijzig';
+ }
+ }
+ print "
\n";
+}
+$nav = getoutput(['login' => ob_get_clean()]);
+
$nav = preg_replace_callback('{(.*?)}', function ($m) {
$request = $_SERVER['REQUEST_URI'];
$html = $request == $m[1] ? $m[2] : $m[0]; # text or full link
@@ -13,16 +36,23 @@ $nav = preg_replace_callback('{(.*?)}', function ($m) {
print $nav;
print "\n\n";
-print ''."\n\n";
-
-include_once 'auth.inc.php';
+print $body;
register_shutdown_function(function () {
- print "
\n\n";
- include 'foot.inc.php';
+ print '\n";
+
+ global $User;
+ if ($User and $User->admin('edit')) {
+ $ckesrc = '/lib/ckeditor'; # local install
+ if (!file_exists(DOCROOT . $ckesrc)) {
+ $ckesrc = '//cdn.ckeditor.com/4.7.3/full-all'; # remote fallback
+ }
+ printf(''."\n", "$ckesrc/ckeditor.js");
+ print ''."\n";
+ }
+
print "