git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
page: ignore output buffer in article render
[minimedit.git]
/
page.inc.php
diff --git
a/page.inc.php
b/page.inc.php
index ae223f1a1f5383f6ca2dbf795f82a7eb27f87940..8eba91bdac04d80ccd3f8566197e67fe476cbee8 100644
(file)
--- a/
page.inc.php
+++ b/
page.inc.php
@@
-1,11
+1,8
@@
<?php
<?php
-$body = getoutput(@$Place);
-
include_once 'head.inc.php';
print "<header>\n";
include_once 'head.inc.php';
print "<header>\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 '<div class="login"><p>';
ob_start();
if ($User and property_exists($User, 'login') and $User->login) {
print '<div class="login"><p>';
@@
-13,8
+10,8
@@
if ($User and property_exists($User, 'login') and $User->login) {
'<span class="icon icon-user">👤</span>',
'/login', $User->login
);
'<span class="icon icon-user">👤</span>',
'/login', $User->login
);
- if ($User->admin("edit
$Page$Args
")) {
- $editpage = $Page
.$Args
;
+ if ($User->admin("edit
{$Page->link}
")) {
+ $editpage = $Page
->link
;
if (is_dir($editpage)) {
if (file_exists("$editpage/index.html")) {
$editpage .= '/index.html';
if (is_dir($editpage)) {
if (file_exists("$editpage/index.html")) {
$editpage .= '/index.html';
@@
-29,7
+26,8
@@
if ($User and property_exists($User, 'login') and $User->login) {
}
print "</p></div>\n";
}
}
print "</p></div>\n";
}
-$nav = getoutput(['login' => ob_get_clean()]);
+$menu->place['login'] = ob_get_clean();
+$nav = $menu->render();
$nav = preg_replace_callback('{<a href="([^"]+)">(.*?)</a>}', function ($m) {
$request = $_SERVER['REQUEST_URI'];
$nav = preg_replace_callback('{<a href="([^"]+)">(.*?)</a>}', function ($m) {
$request = $_SERVER['REQUEST_URI'];
@@
-39,18
+37,18
@@
$nav = preg_replace_callback('{<a href="([^"]+)">(.*?)</a>}', function ($m) {
print $nav;
print "</header>\n\n";
print $nav;
print "</header>\n\n";
-print $
body
;
+print $
Page->render()
;
register_shutdown_function(function () {
print '<footer>';
@include 'footer.inc.html';
print "</footer>\n";
register_shutdown_function(function () {
print '<footer>';
@include 'footer.inc.html';
print "</footer>\n";
- global $User, $Page
, $Args
;
- if ($User and $User->admin("edit
$Page$Args
")) {
+ global $User, $Page;
+ if ($User and $User->admin("edit
{$Page->link}
")) {
$ckesrc = '/lib/ckeditor'; # local install
if (!file_exists(DOCROOT . $ckesrc)) {
$ckesrc = '/lib/ckeditor'; # local install
if (!file_exists(DOCROOT . $ckesrc)) {
- $ckesrc = '//cdn.ckeditor.com/4.
7.3
/full-all'; # remote fallback
+ $ckesrc = '//cdn.ckeditor.com/4.
15.1
/full-all'; # remote fallback
}
printf("<script>var ckesrc = '%s'</script>\n", "$ckesrc/ckeditor.js");
print '<script src="/edit/page.js"></script>'."\n";
}
printf("<script>var ckesrc = '%s'</script>\n", "$ckesrc/ckeditor.js");
print '<script src="/edit/page.js"></script>'."\n";