edit/page: indicate edit replacements in data-dyn attributes
[minimedit.git] / page.inc.php
index c93fcbcd9b68898073c569bac9eb6522b0af93ab..120fb957c2ea35b8f7ab07f56344370128823815 100644 (file)
@@ -5,12 +5,12 @@ include_once 'head.inc.php';
 
 print "<header>\n";
 ob_start();
-include 'menu.html';
+include 'menu.inc.html';
 ob_start();
-if ($User) {
+if ($User and property_exists($User, 'login') and $User->login) {
        print '<div class="login"><p>';
        printf('<span>Ingelogd: <b><a href="%s">%s</a></b></span>', '/login', $User->login);
-       if ($User->admin('edit')) {
+       if ($User->admin("edit $Page$Args")) {
                $editpage = $Page.$Args;
                if (is_dir($editpage)) {
                        if (file_exists("$editpage/index.html")) {
@@ -40,11 +40,11 @@ print $body;
 
 register_shutdown_function(function () {
        print '<footer>';
-       @include 'footer.html';
+       @include 'footer.inc.html';
        print "</footer>\n";
 
-       global $User;
-       if ($User and $User->admin('edit')) {
+       global $User, $Page, $Args;
+       if ($User and $User->admin("edit $Page$Args")) {
                $ckesrc = '/lib/ckeditor'; # local install
                if (!file_exists(DOCROOT . $ckesrc)) {
                        $ckesrc = '//cdn.ckeditor.com/4.7.3/full-all'; # remote fallback