page: prepare php footer include
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 18 Jan 2015 18:52:34 +0000 (19:52 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 18 Jan 2015 18:54:35 +0000 (19:54 +0100)
Superset of footer-noedit.html with partial editing features from
footer.html (missing permission checks) for eventual conversion from SSI.

footer-noedit.html [deleted file]
footer.inc.php [new file with mode: 0644]

diff --git a/footer-noedit.html b/footer-noedit.html
deleted file mode 100644 (file)
index ee61a0c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-</div>
-<hr class="footer" />
-</body></html>
diff --git a/footer.inc.php b/footer.inc.php
new file mode 100644 (file)
index 0000000..30426ea
--- /dev/null
@@ -0,0 +1,29 @@
+</div>
+<hr class="footer" />
+<?php
+if (($notfound = $_SERVER['SCRIPT_NAME'] == '/404.html')) {
+       echo <<<'EOT'
+<script>
+var pagebody = document.getElementsByClassName('article')[0];
+pagebody.innerHTML = '<h2>Nieuwe pagina</h2><p>&nbsp;</p>';
+</script>
+EOT;
+}
+
+define('N', "\n");
+
+$editable = FALSE; // "Beheer toegestaan voor {$_SERVER['REMOTE_ADDR']}:";
+if ($editable) {
+       echo '<p class="footer">'.N;
+       echo $editable.N;
+       echo '<script src="/ckeditor/ckeditor.js"></script>'.N;
+       echo '<script src="/edit.js"></script>'.N;
+       $edit = array_key_exists($_GET['edit']);
+       printf('<a href="?%s">%s</a>'.N,
+               $edit ? '' : 'edit',
+               $edit ? 'lezen' : ($notfound ? 'aanmaken' : 'aanpassen')
+       );
+       echo '</p>'.N;
+}
+
+?></body></html>