From: x2003bruneau Date: Mon, 15 Jan 2007 15:36:42 +0000 (+0000) Subject: Allow smarty tags in wiki pages (only in the the case only admins can edit this page) X-Git-Tag: xorg/0.9.13~128 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=85948b6cd642fc3cea48f7fca2988e39ea4189e4;p=platal.git Allow smarty tags in wiki pages (only in the the case only admins can edit this page) git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1343 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/htdocs/xnet.php b/htdocs/xnet.php index 6d50981..9e4cc29 100644 --- a/htdocs/xnet.php +++ b/htdocs/xnet.php @@ -107,7 +107,13 @@ $page->assign('canedit', wiki_may_have_perms($perms[1])); $page->assign('has_perms', wiki_may_have_perms('admin')); $page->assign('wikipage', str_replace('.', '/', $n)); -$page->assign('pmwiki', $wikiAll); +$page->assign('wikipage', str_replace('.', '/', $n)); +if ($perms[1] == 'admin' && !Env::v('action')) { + $page->assign('pmwiki_cache', $wiki_cache); +} else { + $page->assign('pmwiki', $wikiAll); + $page->assign('text', true); +} $page->addCssLink('wiki.css'); $page->addJsLink('wiki.js'); diff --git a/htdocs/xorg.php b/htdocs/xorg.php index 81924b1..d402773 100644 --- a/htdocs/xorg.php +++ b/htdocs/xorg.php @@ -115,8 +115,12 @@ $page->assign('canedit', wiki_may_have_perms($perms[1])); $page->assign('has_perms', wiki_may_have_perms('admin')); $page->assign('wikipage', str_replace('.', '/', $n)); -$page->assign('pmwiki', $wikiAll); - +if ($perms[1] == 'admin' && !Env::v('action')) { + $page->assign('pmwiki_cache', $wiki_cache); +} else { + $page->assign('pmwiki', $wikiAll); + $page->assign('text', true); +} $page->addCssLink('wiki.css'); $page->addJsLink('wiki.js'); diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 8f548f9..b92cbdc 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -38,7 +38,7 @@ class XorgPage extends PlatalPage { global $globals, $platal; $this->assign('globals', $globals); - if ($platal->path == 'register') { + if (isset($platal) && $platal->path == 'register') { $skin = 'register.tpl'; } else { $skin = S::v('skin', 'default.tpl');