page: write edit includes from common script
[minimedit.git] / page.inc.php
index 4cc693942f09a1659d0c20a2ec58c196265e7f13..654f37fa7ebeee2a412b2348fc3bab61d1ac4d88 100644 (file)
@@ -24,8 +24,18 @@ print "</header>\n\n";
 
 print $body;
 
+$footinc = realpath('footer.html'); # cwd lost during shutdown
 register_shutdown_function(function () {
-       include 'foot.inc.php';
+       print '<footer>';
+       @include $GLOBALS['footinc'];
+       print "</footer>\n";
+
+       global $User;
+       if (isset($User) and $User['admin']) {
+               print '<script src="//cdn.ckeditor.com/4.7.3/full-all/ckeditor.js"></script>'."\n";
+               print '<script src="/edit.js"></script>'."\n";
+       }
+
        print "</body></html>\n";
 });