X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fxorg.php;h=c52959d5a685cc82ad4973511f9826f6afad6174;hb=028726d48c0dae158cc947971992ce1e8e7dfb11;hp=d402773b4276428b726773a583dfced8509cc56c;hpb=85948b6cd642fc3cea48f7fca2988e39ea4189e4;p=platal.git diff --git a/htdocs/xorg.php b/htdocs/xorg.php index d402773..c52959d 100644 --- a/htdocs/xorg.php +++ b/htdocs/xorg.php @@ -19,16 +19,15 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -// $GLOBALS['IS_XNET_SITE'] = true; - require_once dirname(__FILE__).'/../include/xorg.inc.php'; +global $globals, $platal, $page; if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) { $platal = new Platal('auth', 'banana', 'carnet', 'email', 'events', 'geoloc', 'lists', 'marketing', 'payment', 'platal', 'profile', 'register', 'search', 'stats', 'admin', - 'newsletter'); + 'newsletter', 'axletter', 'bandeau', 'survey'); $platal->run(); exit; @@ -36,94 +35,7 @@ if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) { /*** WIKI CODE ***/ -require_once 'wiki.inc.php'; - -$n = wiki_pagename(); -if (!$n) { - pl_redirect(''); -} - -new_skinned_page('core/wiki.tpl'); -$perms = wiki_get_perms($n); - -if (Env::v('display') == 'light') { - $page->assign('simple', true); -} - -switch (Env::v('action')) { - case '': - wiki_apply_perms($perms[0]); - break; - - case 'edit': - wiki_apply_perms($perms[1]); - break; - - default: - wiki_apply_perms('admin'); - break; -} - -if ($p = Post::v('setrperms')) { - wiki_apply_perms('admin'); - if (wiki_set_perms($n, $p, $perms[1])) { - $perms = wiki_get_perms($n); - $page->trig('Permissions mises à jour'); - } -} - -if ($p = Post::v('setwperms')) { - wiki_apply_perms('admin'); - if (wiki_set_perms($n, $perms[0], $p)) { - $perms = wiki_get_perms($n); - $page->trig('Permissions mises à jour'); - } -} - -$wiki_cache = wiki_work_dir().'/cache_'.$n.'.tpl'; -$cache_exists = file_exists($wiki_cache); - -if (Env::v('action') || !$cache_exists) { - @unlink($wiki_cache); - - // we leave pmwiki do whatever it wants and store everything - ob_start(); - require_once($globals->spoolroot.'/wiki/pmwiki.php'); - - $wikiAll = ob_get_clean(); - // the pmwiki skin we are using (almost empty) has these keywords: - $i = strpos($wikiAll, ""); - $j = strpos($wikiAll, "", $i); -} - -if (Env::v('action')) { - $page->assign('xorg_extra_header', substr($wikiAll, 0, $i)); - $wikiAll = substr($wikiAll, $j); -} else { - if (!$cache_exists) { - $wikiAll = substr($wikiAll, $j); - wiki_putfile($wiki_cache, $wikiAll); - } else { - $wikiAll = file_get_contents($wiki_cache); - } -} - -$page->assign('perms', $perms); -$page->assign('perms_opts', wiki_perms_options()); - -$page->assign('canedit', wiki_may_have_perms($perms[1])); -$page->assign('has_perms', wiki_may_have_perms('admin')); - -$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'); - -$page->run(); +include 'wiki/engine.php'; +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>