X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/5d12bd9eb6674e9101a6a89c1b7a78ac1940fe6e..fc74e45e15e3b1f17312f229496c25f7caff7d60:/page.inc.php diff --git a/page.inc.php b/page.inc.php index 393d614..b6723e9 100644 --- a/page.inc.php +++ b/page.inc.php @@ -1,16 +1,16 @@ \n"; ob_start(); -include DOCROOT.'menu.html'; +include 'menu.html'; ob_start(); -if (isset($User)) { +if (!empty($User)) { print '
'; printf('Ingelogd: %s', '/login', $User['name']); - if ($User['admin']) { + if (!empty($User['admin'])) { $editpage = $Page.$Args; if (is_dir($editpage)) { if (file_exists("$editpage/index.html")) { @@ -20,7 +20,7 @@ if (isset($User)) { else { $editpage .= '.html'; } - if (is_writable($editpage)) { + if (!file_exists($editpage) or is_writable($editpage)) { print ' Wijzig'; } } @@ -33,12 +33,6 @@ $nav = preg_replace_callback('{(.*?)}', function ($m) { $html = $request == $m[1] ? $m[2] : $m[0]; # text or full link return $m[1] == substr($request, 0, strlen($m[1])) ? "$html" : $html; }, $nav); -if (isset($User)) { - $nav = preg_replace('{\s*