From d575b75cff2a418992a54bfa311c888cab19bd8b Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sat, 22 Oct 2005 11:51:34 +0000 Subject: [PATCH] simplify the scheme a bit git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@127 839d8a87-29fc-0310-9880-83ba4fa771e5 --- htdocs/wiki.php | 23 ++++++++++++++--------- include/pmwiki.php | 41 ----------------------------------------- 2 files changed, 14 insertions(+), 50 deletions(-) delete mode 100644 include/pmwiki.php diff --git a/htdocs/wiki.php b/htdocs/wiki.php index 33cc717..bca07b3 100644 --- a/htdocs/wiki.php +++ b/htdocs/wiki.php @@ -20,17 +20,22 @@ ***************************************************************************/ require_once("xorg.inc.php"); -if (Env::has('response')) - new_skinned_page('wiki.tpl', AUTH_MDP); -else - new_skinned_page('wiki.tpl', AUTH_PUBLIC); +new_skinned_page('wiki.tpl', Env::has('response') ? AUTH_MDP : AUTH_PUBLIC); + +if ($globals->wiki->wikidir) { + ob_start(); + require_once(dirname(dirname(__FILE__)).'/'.$globals->wiki->wikidir.'/pmwiki.php'); + + $wikiAll = ob_get_clean(); + $i = strpos($wikiAll, ""); + $j = strpos($wikiAll, "", $i); + + $page->assign('xorg_extra_header', substr($wikiAll, 0, $i)); + $page->assign('menu-pmwiki', substr($wikiAll, $i, $j-$i)); + $page->assign('pmwiki', substr($wikiAll, $j)); +} -require_once('pmwiki.php'); - $page->addCssLink('css/wiki.css'); -$page->assign('xorg_extra_header', substr($wikiAll, 0, $i)); -$page->assign('menu-pmwiki', $wikiMenu); -$page->assign('pmwiki', $wikiTxt); $page->run(); ?> diff --git a/include/pmwiki.php b/include/pmwiki.php deleted file mode 100644 index 480875b..0000000 --- a/include/pmwiki.php +++ /dev/null @@ -1,41 +0,0 @@ -wiki->wikidir) -{ - ob_start(); - require_once($globals->spoolroot.$globals->wiki->wikidir.'/pmwiki.php'); - - $wikiAll = ob_get_clean(); - $i = strpos($wikiAll, ""); - $j = strpos($wikiAll, "", $i); - - $wikiHeaders = substr($wikiAll, 0, $i); - - $wikiMenu = substr($wikiAll, $i, $j-$i); - - $wikiTxt = substr($wikiAll, $j); - -} - -?> -- 2.1.4