1f206a5db00eb9d0654389d1bd4dc3ae0d5283e8
2 /***************************************************************************
3 * Copyright (C) 2003-2007 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
22 $GLOBALS['IS_XNET_SITE'] = true
;
24 require_once dirname(__FILE__
).'/../include/xnet.inc.php';
26 if (!($path = Env
::v('n')) ||
substr($path, 0, 4) != 'Xnet') {
27 $platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'geoloc', 'payment');
35 require_once 'wiki.inc.php';
42 new_skinned_page('core/wiki.tpl');
43 $perms = wiki_get_perms($n);
45 if ($p = Post
::v('setrperms')) {
46 wiki_apply_perms('admin');
47 if (wiki_set_perms($n, $p, $perms[1])) {
48 $perms = wiki_get_perms($n);
49 $page->trig('Permissions mises à jour');
53 if ($p = Post
::v('setwperms')) {
54 wiki_apply_perms('admin');
55 if (wiki_set_perms($n, $perms[0], $p)) {
56 $perms = wiki_get_perms($n);
57 $page->trig('Permissions mises à jour');
61 $wiki_cache = wiki_work_dir().'/cache_'.wiki_filename($n).'.tpl';
62 $cache_exists = file_exists($wiki_cache);
64 if (Env
::v('action') ||
!$cache_exists) {
67 // we leave pmwiki do whatever it wants and store everything
69 require_once($globals->spoolroot
.'/wiki/pmwiki.php');
71 $wikiAll = ob_get_clean();
72 // the pmwiki skin we are using (almost empty) has these keywords:
73 $i = strpos($wikiAll, "<!--/HeaderText-->");
74 $j = strpos($wikiAll, "<!--/PageLeftFmt-->", $i);
77 if (Env
::v('action')) {
78 $page->assign('xorg_extra_header', substr($wikiAll, 0, $i));
79 $wikiAll = substr($wikiAll, $j);
82 $wikiAll = substr($wikiAll, $j);
83 wiki_putfile($wiki_cache, $wikiAll);
85 $wikiAll = file_get_contents($wiki_cache);
89 switch (Env
::v('action')) {
90 case '': case 'search':
91 wiki_apply_perms($perms[0]);
95 wiki_apply_perms($perms[1]);
99 wiki_apply_perms('admin');
103 $page->assign('perms', $perms);
104 $page->assign('perms_opts', wiki_perms_options());
106 $page->assign('canedit', wiki_may_have_perms($perms[1]));
107 $page->assign('has_perms', wiki_may_have_perms('admin'));
109 $page->assign('wikipage', str_replace('.', '/', $n));
110 $page->assign('wikipage', str_replace('.', '/', $n));
111 if ($perms[1] == 'admin' && !Env
::v('action')) {
112 $page->assign('pmwiki_cache', $wiki_cache);
114 $page->assign('pmwiki', $wikiAll);
115 $page->assign('text', true
);
118 $page->addCssLink('wiki.css');
119 $page->addJsLink('wiki.js');