<?php
/***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
+ * Copyright (C) 2003-2006 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-require_once("xorg.inc.php");
-new_skinned_page('wiki.tpl', Env::has('response') ? AUTH_MDP : AUTH_PUBLIC);
+require_once 'xorg.inc.php';
-if ($globals->wiki->wikidir) {
- ob_start();
- require_once(dirname(dirname(__FILE__)).'/'.$globals->wiki->wikidir.'/pmwiki.php');
+// this page is to create a smarty template page from a wiki file
+// the wiki engine used is pmwiki.
+// the templates created are stored in wiki.d/cache_wikiword.tpl
+
+// some page can be seen by everybody (public), but to validate a password
+// if we arrive here before setting new access we need to try an auth
+new_skinned_page('wiki.tpl');
- $wikiAll = ob_get_clean();
- $i = strpos($wikiAll, "<!--/HeaderText-->");
- $j = strpos($wikiAll, "<!--/PageLeftFmt-->", $i);
+if ($globals->wiki->wikidir) {
+ $wikisite = 'xorg';
+ require_once 'wiki.inc.php';
+ $page->changeTpl($wiki_template);
+}
- $page->assign('xorg_extra_header', substr($wikiAll, 0, $i));
- $page->assign('menu-pmwiki', substr($wikiAll, $i, $j-$i));
- $page->assign('pmwiki', substr($wikiAll, $j));
+if (!Env::get('action')) {
+ $page->addJsLink('javascript/wiki.js');
}
+wiki_assign_auth();
$page->addCssLink('css/wiki.css');
$page->run();