From: Mischa POSLAWSKY Date: Fri, 15 Sep 2017 13:42:59 +0000 (+0200) Subject: page: edit template in static contents X-Git-Tag: v2.2~16 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/e68f7733ec6b846dc82b67e52588ae0ba302b76b page: edit template in static contents Allow post-processing by relevant scripts. --- diff --git a/page.php b/page.php index 9e3388e..3c0977e 100644 --- a/page.php +++ b/page.php @@ -52,6 +52,9 @@ if (file_exists("$Page$Args/index.html")) { elseif (file_exists("$Page$Args.html")) { $found = include "./$Page$Args.html"; } +elseif (isset($User) and $User['admin']) { + $found = require './template.html'; +} print "\n\n"; @@ -76,14 +79,9 @@ include_once 'page.inc.php'; if (!$found) { # no resulting output - if (isset($User) and $User['admin']) { - require './template.html'; - } - else { - http_response_code(404); - ob_start(); - require "./404.html"; - print getoutput([ 'url' => htmlspecialchars($_SERVER['REQUEST_URI']) ]); - } + http_response_code(404); + ob_start(); + require "./404.html"; + print getoutput([ 'url' => htmlspecialchars($_SERVER['REQUEST_URI']) ]); }