545 |
ddelon |
1 |
<?php
|
581 |
ddelon |
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
545 |
ddelon |
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This file is part of Integrateur Wikini. |
|
|
|
9 |
// | |
|
|
|
10 |
// | Foobar is free software; you can redistribute it and/or modify |
|
|
|
11 |
// | it under the terms of the GNU General Public License as published by |
|
|
|
12 |
// | the Free Software Foundation; either version 2 of the License, or |
|
|
|
13 |
// | (at your option) any later version. |
|
|
|
14 |
// | |
|
|
|
15 |
// | Foobar is distributed in the hope that it will be useful, |
|
|
|
16 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
17 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
18 |
// | GNU General Public License for more details. |
|
|
|
19 |
// | |
|
|
|
20 |
// | You should have received a copy of the GNU General Public License |
|
|
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
|
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
586 |
ddelon |
24 |
// CVS : $Id: iw_integrateur.fonct.php,v 1.9 2005-11-02 21:51:44 ddelon Exp $
|
545 |
ddelon |
25 |
/**
|
|
|
26 |
* Fonctions de l'integrateur de page Wikini
|
|
|
27 |
*
|
|
|
28 |
* Application permettant d'intégrer des pages wikini dans Papyrus.
|
|
|
29 |
*
|
|
|
30 |
*@package IntegrateurWikini
|
|
|
31 |
//Auteur original :
|
|
|
32 |
*@author David Delon <david.delon@clapas.net>
|
|
|
33 |
//Autres auteurs :
|
|
|
34 |
*@author Aucun
|
|
|
35 |
*@copyright Tela-Botanica 2000-2004
|
586 |
ddelon |
36 |
*@version $Revision: 1.9 $ $Date: 2005-11-02 21:51:44 $
|
545 |
ddelon |
37 |
*
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
// | ENTETE du PROGRAMME |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
/** Inclusion de la classe PEAR de gestion des URL. */
|
|
|
46 |
|
|
|
47 |
$GLOBALS['_PAPYRUS_']['erreur']->setActive(0);
|
|
|
48 |
|
|
|
49 |
require_once 'Net/URL.php';
|
|
|
50 |
|
|
|
51 |
// TODO : un seul fichier de configuration ?
|
|
|
52 |
/** Inclusion du fichier de configuration de cette application.*/
|
|
|
53 |
require_once 'client/integrateur_wikini/configuration/adwi_configuration.inc.php';
|
|
|
54 |
|
|
|
55 |
require_once ADWI_CHEMIN_BIBLIOTHEQUE.'adwi_wikini.fonct.php';
|
|
|
56 |
|
|
|
57 |
/** Inclusion du fichier de configuration général de IntegrateurWikini.*/
|
|
|
58 |
require_once 'client'.GEN_SEP.'integrateur_wikini'.GEN_SEP.'configuration'.GEN_SEP.'iw_config.inc.php';
|
|
|
59 |
|
|
|
60 |
/** Inclusion du fichier permettant d'encoder du texte mais pas les balises XHTML.*/
|
|
|
61 |
require_once IW_CHEMIN_BIBLIO.'iw_encodage.fonct.php';
|
|
|
62 |
/** Inclusion du fichier permettant d'inclure les données dans du XHTML.*/
|
|
|
63 |
require_once IW_CHEMIN_BIBLIO.'iw_affichage_xhtml.fonct.php';
|
|
|
64 |
|
|
|
65 |
global $wikini_config_defaut;
|
|
|
66 |
global $wiki;
|
|
|
67 |
global $wiki_p;
|
|
|
68 |
|
|
|
69 |
// $_REQUEST['wiki'] est obligatoire, car wakka.php envoie un redirect si non detecté, avec perte de tout l'environnement !
|
|
|
70 |
|
|
|
71 |
if ( ! isset( $_REQUEST['wiki'] ) ) {
|
|
|
72 |
$_REQUEST['wiki'] = $wikini_config_defaut['root_page'];
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
$server=$_SERVER['PHP_SELF'];
|
|
|
76 |
$_SERVER['PHP_SELF']="wakka.php";
|
|
|
77 |
|
|
|
78 |
// Utilise le wakkaconfig de la racine ...
|
|
|
79 |
// TODO : un wiki par défaut pour chaque papyrus à l'installation de Papyrus
|
|
|
80 |
// TODO : verifier bon dimensionnement des champs et clef de la table papyrus_wiki
|
|
|
81 |
// TODO : creation des tables par defaut à l'installation d'un wikini
|
|
|
82 |
// TODO : Fusion des fichiers de configuration ?
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
ob_start();
|
|
|
86 |
|
|
|
87 |
include_once IW_CHEMIN_WIKINI_COURANT.'wakka.php';
|
556 |
ddelon |
88 |
include_once(IW_CHEMIN_WIKINI_COURANT."/formatters/tableaux.php");
|
|
|
89 |
include_once(IW_CHEMIN_WIKINI_COURANT."/actions/attach.class.php");
|
545 |
ddelon |
90 |
|
|
|
91 |
ob_end_clean();
|
|
|
92 |
$_SERVER['PHP_SELF']=$server;
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
// On surcharge la classe Wiki pour en faire ce qu'on en veut
|
|
|
96 |
Class Wiki_Papyrus extends Wiki {
|
581 |
ddelon |
97 |
|
|
|
98 |
|
545 |
ddelon |
99 |
function Header() {
|
581 |
ddelon |
100 |
|
545 |
ddelon |
101 |
return;
|
581 |
ddelon |
102 |
}
|
|
|
103 |
|
545 |
ddelon |
104 |
function Footer() {
|
580 |
ddelon |
105 |
echo "<div class=\"footer\">";
|
|
|
106 |
echo $this->HasAccess("write") ? "<a href=\"".$this->href("edit")."\" title=\"Cliquez pour modifier cette page.\">Modifier cette page</a> ::\n" : "";
|
|
|
107 |
echo $this->GetPageTime() ? "<a href=\"".$this->href("revisions")."\" title=\"Cliquez pour voir les dernières modifications sur cette page.\">".$this->GetPageTime()."</a> ::\n" : "";
|
|
|
108 |
// if this page exists
|
|
|
109 |
if ($this->page)
|
|
|
110 |
{
|
|
|
111 |
// if owner is current user
|
|
|
112 |
if ($this->UserIsOwner())
|
|
|
113 |
{
|
581 |
ddelon |
114 |
echo
|
580 |
ddelon |
115 |
"Propriétaire : vous :: \n",
|
|
|
116 |
"<a href=\"",$this->href("acls")."\" title=\"Cliquez pour modifer les permissions de cette page.\">Éditer permissions</a> :: \n",
|
|
|
117 |
"<a href=\"",$this->href("deletepage")."\">Supprimer</a> :: \n";
|
|
|
118 |
}
|
|
|
119 |
else
|
|
|
120 |
{
|
|
|
121 |
if ($owner = $this->GetPageOwner())
|
|
|
122 |
{
|
|
|
123 |
echo "Propriétaire : ",$this->Format($owner);
|
|
|
124 |
}
|
|
|
125 |
else
|
|
|
126 |
{
|
|
|
127 |
echo "Pas de propriétaire ";
|
|
|
128 |
echo ($this->GetUser() ? "(<a href=\"".$this->href("claim")."\">Appropriation</a>)" : "");
|
|
|
129 |
}
|
|
|
130 |
echo " :: \n";
|
|
|
131 |
}
|
|
|
132 |
}
|
|
|
133 |
echo "Vous êtes ";
|
|
|
134 |
echo $this->Format($this->GetUserName());
|
|
|
135 |
echo "</div>";
|
581 |
ddelon |
136 |
|
545 |
ddelon |
137 |
}
|
581 |
ddelon |
138 |
|
545 |
ddelon |
139 |
function FormOpen($method = "", $tag = "", $formMethod = "post") {
|
581 |
ddelon |
140 |
|
|
|
141 |
// Le diff ne fonctionne pas avec la methode get dans papyrus. On surcharge avec du post.
|
|
|
142 |
|
545 |
ddelon |
143 |
if (($method=="diff") && $formMethod=="get") {
|
581 |
ddelon |
144 |
$formMethod="post";
|
545 |
ddelon |
145 |
}
|
581 |
ddelon |
146 |
|
545 |
ddelon |
147 |
if ($method=="edit") {
|
|
|
148 |
$result = "<form id=\"ACEditor\" name=\"ACEditor\" action=\"".$this->href($method, $tag)."\" method=\"".$formMethod."\">\n";
|
|
|
149 |
return $result;
|
|
|
150 |
}
|
581 |
ddelon |
151 |
|
545 |
ddelon |
152 |
return parent::FormOpen($method,$tag, $formMethod);
|
581 |
ddelon |
153 |
|
545 |
ddelon |
154 |
}
|
|
|
155 |
// Detournement des handlers : comme ca on peut faire ce que l'on veut ....
|
|
|
156 |
function Method($method) {
|
581 |
ddelon |
157 |
|
545 |
ddelon |
158 |
if ($method=="edit") {
|
581 |
ddelon |
159 |
|
545 |
ddelon |
160 |
$result='';
|
581 |
ddelon |
161 |
|
545 |
ddelon |
162 |
if ($_POST) {
|
|
|
163 |
if ($_POST["submit"] == "Sauver") {
|
|
|
164 |
// check for overwriting
|
|
|
165 |
if ($this->page) {
|
|
|
166 |
if ($this->page["id"] != $_POST["previous"]) {
|
|
|
167 |
$error = "ALERTE : ".
|
|
|
168 |
"Cette page a été modifiée par quelqu'un d'autre pendant que vous l'éditiez.<br />\n".
|
|
|
169 |
"Veuillez copier vos changements et rééditer cette page.\n";
|
|
|
170 |
}
|
|
|
171 |
}
|
|
|
172 |
// store
|
|
|
173 |
if (!$error) {
|
|
|
174 |
$body = str_replace("\r", "", $_POST["body"]);
|
|
|
175 |
// test si la nouvelle page est differente de la précédente
|
|
|
176 |
if(rtrim($body)==rtrim($this->page["body"])) {
|
|
|
177 |
$this->SetMessage("Cette page n\'a pas été enregistrée car elle n\'a subi aucune modification.");
|
|
|
178 |
$this->Redirect($this->href());
|
|
|
179 |
}
|
581 |
ddelon |
180 |
|
545 |
ddelon |
181 |
// add page (revisions)
|
|
|
182 |
$this->SavePage($this->tag, $body);
|
581 |
ddelon |
183 |
|
545 |
ddelon |
184 |
// now we render it internally so we can write the updated link table.
|
|
|
185 |
$this->ClearLinkTable();
|
|
|
186 |
$this->StartLinkTracking();
|
|
|
187 |
$dummy = $this->Header();
|
|
|
188 |
$dummy .= $this->Format($body);
|
|
|
189 |
$dummy .= $this->Footer();
|
|
|
190 |
$this->StopLinkTracking();
|
|
|
191 |
$this->WriteLinkTable();
|
|
|
192 |
$this->ClearLinkTable();
|
581 |
ddelon |
193 |
|
545 |
ddelon |
194 |
// forward
|
|
|
195 |
$this->Redirect($this->href());
|
|
|
196 |
}
|
|
|
197 |
}
|
|
|
198 |
}
|
|
|
199 |
|
|
|
200 |
// fetch fields
|
|
|
201 |
if (!$previous = $_POST["previous"]) $previous = $this->page["id"];
|
|
|
202 |
if (!$body = $_POST["body"]) $body = $this->page["body"];
|
581 |
ddelon |
203 |
|
545 |
ddelon |
204 |
// preview?
|
|
|
205 |
if ($_POST["submit"] == "Aperçu")
|
|
|
206 |
{
|
|
|
207 |
$result .=
|
|
|
208 |
"<div class=\"prev_alert\"><strong>Aperçu</strong></div>\n".
|
|
|
209 |
$this->Format($body)."\n\n".
|
|
|
210 |
$this->FormOpen("edit").
|
|
|
211 |
"<input type=\"hidden\" name=\"previous\" value=\"".$previous."\" />\n".
|
|
|
212 |
"<input type=\"hidden\" name=\"body\" value=\"".htmlentities($body)."\" />\n".
|
|
|
213 |
"<br />\n".
|
|
|
214 |
"<input name=\"submit\" type=\"submit\" value=\"Sauver\" accesskey=\"s\" />\n".
|
|
|
215 |
"<input name=\"submit\" type=\"submit\" value=\"Rééditer \" accesskey=\"p\" />\n".
|
|
|
216 |
"<input type=\"button\" value=\"Annulation\" onclick=\"document.location='".$this->href("")."';\" />\n".
|
|
|
217 |
$this->FormClose()."\n";
|
|
|
218 |
return $result;
|
|
|
219 |
}
|
|
|
220 |
else
|
|
|
221 |
{
|
581 |
ddelon |
222 |
|
545 |
ddelon |
223 |
require_once(IW_CHEMIN_BIBLIO_ACEDITOR."ACeditor.buttonsBar.php");
|
581 |
ddelon |
224 |
|
545 |
ddelon |
225 |
$result .=
|
|
|
226 |
$this->FormOpen("edit").
|
|
|
227 |
"<input type=\"hidden\" name=\"previous\" value=\"".$previous."\" />\n".$ACbuttonsBar.
|
|
|
228 |
"<textarea onkeydown=\"fKeyDown()\" name=\"body\" cols=\"60\" rows=\"40\" wrap=\"soft\" class=\"edit\">\n".
|
|
|
229 |
htmlspecialchars($body).
|
|
|
230 |
"\n</textarea><br />\n".
|
|
|
231 |
($this->config["preview_before_save"] ? "" : "<input name=\"submit\" type=\"submit\" value=\"Sauver\" accesskey=\"s\" />\n").
|
|
|
232 |
"<input name=\"submit\" type=\"submit\" value=\"Aperçu\" accesskey=\"p\" />\n".
|
|
|
233 |
"<input type=\"button\" value=\"Annulation\" onclick=\"document.location='".$this->href("")."';\" />\n".
|
|
|
234 |
$this->FormClose();
|
581 |
ddelon |
235 |
|
545 |
ddelon |
236 |
return $result;
|
|
|
237 |
}
|
581 |
ddelon |
238 |
|
545 |
ddelon |
239 |
}
|
|
|
240 |
else {
|
|
|
241 |
return parent::Method($method);
|
|
|
242 |
}
|
|
|
243 |
}
|
581 |
ddelon |
244 |
|
|
|
245 |
|
|
|
246 |
// Surcharge Format a cause probleme de chemin.
|
|
|
247 |
|
545 |
ddelon |
248 |
function Format($text, $formatter = "wakka") {
|
581 |
ddelon |
249 |
return $this->IncludeBuffered(IW_CHEMIN_WIKINI_COURANT_FORMATTER.$formatter.".php", "<i>Impossible de trouver le formateur \"$formatter\"</i>", compact("text"));
|
545 |
ddelon |
250 |
}
|
581 |
ddelon |
251 |
|
|
|
252 |
|
|
|
253 |
// Identification
|
|
|
254 |
|
584 |
ddelon |
255 |
function SetUser($user, $remember) {
|
|
|
256 |
// Appel à partir de Papyrus
|
|
|
257 |
if ($user=='') {
|
|
|
258 |
$remember=1;
|
586 |
ddelon |
259 |
$wiki_prenom=$GLOBALS['_GEN_commun']['pear_auth']->getAuthData($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_personne_prenom);
|
|
|
260 |
$wiki_prenom = strtolower(trim(strtr($wiki_prenom, "àâéêèëîïôöùûüç", "aaeeeeiioouuuc")));
|
|
|
261 |
$wiki_prenom = ucfirst($wiki_prenom);
|
|
|
262 |
$wiki_nom=$GLOBALS['_GEN_commun']['pear_auth']->getAuthData($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_personne_nom);
|
|
|
263 |
$wiki_nom = strtolower(trim(strtr($wiki_nom, "àâéêèëîïôöùûüç", "aaeeeeiioouuuc")));
|
|
|
264 |
$wiki_nom = ucfirst($wiki_nom);
|
|
|
265 |
$_SESSION["user"]["name"] = $wiki_prenom.$wiki_nom;
|
584 |
ddelon |
266 |
$_SESSION["user"]["password"] = "wikini";
|
|
|
267 |
$_SESSION["user"]["changescount"] = 100;
|
|
|
268 |
$this->SetPersistentCookie("name", $user["name"], $remember);
|
|
|
269 |
$this->SetPersistentCookie("password", $user["password"], $remember);
|
|
|
270 |
$this->SetPersistentCookie("remember", $remember, $remember);
|
|
|
271 |
}
|
|
|
272 |
else {
|
|
|
273 |
parent::Setuser($user,$remember);
|
|
|
274 |
}
|
|
|
275 |
|
580 |
ddelon |
276 |
}
|
581 |
ddelon |
277 |
|
|
|
278 |
|
545 |
ddelon |
279 |
}
|
|
|
280 |
|
581 |
ddelon |
281 |
|
|
|
282 |
|
545 |
ddelon |
283 |
// Appel du fichier de traduction des textes de l'application Integrateur Wikini
|
|
|
284 |
if (file_exists(IW_CHEMIN_LANGUES.'iw_langue_'.IW_I18N.'.inc.php')) {
|
|
|
285 |
/** Inclusion du fichier de traduction de l'application Integrateur Wikini. */
|
|
|
286 |
include_once IW_CHEMIN_LANGUES.'iw_langue_'.IW_I18N.'.inc.php';
|
|
|
287 |
} else {
|
|
|
288 |
/** Inclusion du fichier de traduction fr par défaut. */
|
|
|
289 |
include_once IW_CHEMIN_LANGUES.'iw_langue_fr.inc.php';
|
|
|
290 |
}
|
|
|
291 |
|
|
|
292 |
$GLOBALS['_PAPYRUS_']['erreur']->setActive(1);
|
|
|
293 |
/**
|
581 |
ddelon |
294 |
*
|
545 |
ddelon |
295 |
* Fonction afficherPageMenuWikini()
|
581 |
ddelon |
296 |
*
|
545 |
ddelon |
297 |
* Renvoie le contenu de la page Menu de Wikini
|
|
|
298 |
*
|
|
|
299 |
* @return string
|
|
|
300 |
* @access public
|
|
|
301 |
*/
|
581 |
ddelon |
302 |
|
545 |
ddelon |
303 |
function afficherPageMenuWikini()
|
|
|
304 |
{
|
581 |
ddelon |
305 |
|
545 |
ddelon |
306 |
$GLOBALS['_PAPYRUS_']['erreur']->setActive(0);
|
|
|
307 |
|
581 |
ddelon |
308 |
|
|
|
309 |
|
545 |
ddelon |
310 |
global $wiki;
|
|
|
311 |
global $wikini_config_defaut;
|
|
|
312 |
$sortie='';
|
|
|
313 |
$wakkaConfig = $GLOBALS['wikini_config_defaut'];
|
|
|
314 |
$wiki = new Wiki_Papyrus($wakkaConfig);
|
|
|
315 |
|
|
|
316 |
// Suppression des slash.
|
|
|
317 |
$_REQUEST['wiki'] = preg_replace("/^\//", '', $_REQUEST['wiki']);
|
|
|
318 |
|
|
|
319 |
// split into page/method
|
|
|
320 |
if ( preg_match( "#^(.+?)/(.*)$#", $_REQUEST['wiki'], $matches ) ) {
|
|
|
321 |
list(, $page, $method) = $matches;
|
|
|
322 |
} else if ( preg_match( "#^(.*)$#", $_REQUEST['wiki'], $matches ) ) {
|
|
|
323 |
list(, $page) = $matches;
|
|
|
324 |
}
|
|
|
325 |
|
|
|
326 |
$server=$_SERVER['PHP_SELF'];
|
|
|
327 |
$_SERVER['PHP_SELF']="wakka.php";
|
581 |
ddelon |
328 |
|
545 |
ddelon |
329 |
$contenu=$wiki->LoadPage("PageMenu");
|
581 |
ddelon |
330 |
|
585 |
ddelon |
331 |
$sortie.="<div id=\"menu_wikini\">";
|
581 |
ddelon |
332 |
$sortie.=$wiki->Format($contenu['body']);
|
585 |
ddelon |
333 |
$sortie.="</div>";
|
545 |
ddelon |
334 |
|
|
|
335 |
$_SERVER['PHP_SELF']=$server;
|
581 |
ddelon |
336 |
|
545 |
ddelon |
337 |
$GLOBALS['_PAPYRUS_']['erreur']->setActive(1);
|
581 |
ddelon |
338 |
|
545 |
ddelon |
339 |
return $sortie;
|
581 |
ddelon |
340 |
|
|
|
341 |
}
|
|
|
342 |
|
|
|
343 |
|
545 |
ddelon |
344 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
345 |
// | CORPS du PROGRAMME |
|
|
|
346 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
347 |
/** Fonction afficherPageWikini() - Fonction appelé par le gestionnaire Papyrus.
|
|
|
348 |
*
|
|
|
349 |
* Elle retourne le contenu de l'application.
|
|
|
350 |
*
|
|
|
351 |
* @return string du code XHTML correspondant au contenu renvoyé par l'application.
|
|
|
352 |
*/
|
|
|
353 |
function afficherPageWikini()
|
|
|
354 |
{
|
|
|
355 |
|
|
|
356 |
$GLOBALS['_PAPYRUS_']['erreur']->setActive(0);
|
581 |
ddelon |
357 |
|
545 |
ddelon |
358 |
// Ajout d'une feuille de style externe
|
|
|
359 |
GEN_stockerStyleExterne ('wikini', 'client/integrateur_wikini/presentations/styles/wikini.css') ;
|
581 |
ddelon |
360 |
|
545 |
ddelon |
361 |
// TODO
|
|
|
362 |
// Changement du niveau d'erreur pour éviter les Notices PHP dues à Wikini
|
581 |
ddelon |
363 |
|
|
|
364 |
|
545 |
ddelon |
365 |
global $wiki;
|
|
|
366 |
global $wikini_config_defaut;
|
|
|
367 |
$sortie='';
|
|
|
368 |
$wakkaConfig = $GLOBALS['wikini_config_defaut'];
|
|
|
369 |
$wiki = new Wiki_Papyrus($wakkaConfig);
|
|
|
370 |
|
|
|
371 |
|
581 |
ddelon |
372 |
if ($GLOBALS['_GEN_commun']['pear_auth']->checkAuth()) {
|
|
|
373 |
if (!isset($_SESSION["user"]) || ($_SESSION["user"]=="")) {
|
580 |
ddelon |
374 |
$wiki->SetUser('');
|
|
|
375 |
}
|
|
|
376 |
}
|
|
|
377 |
else {
|
|
|
378 |
$wiki->LogoutUser();
|
|
|
379 |
}
|
581 |
ddelon |
380 |
|
545 |
ddelon |
381 |
// Gestion de la variable de session "linktracking"
|
|
|
382 |
if ( ! isset( $_SESSION['linktracking'] ) ) {
|
|
|
383 |
$_SESSION['linktracking'] = 1;
|
|
|
384 |
}
|
|
|
385 |
|
|
|
386 |
// Suppression des slash.
|
|
|
387 |
$_REQUEST['wiki'] = preg_replace("/^\//", '', $_REQUEST['wiki']);
|
|
|
388 |
|
|
|
389 |
// split into page/method
|
|
|
390 |
if ( preg_match( "#^(.+?)/(.*)$#", $_REQUEST['wiki'], $matches ) ) {
|
|
|
391 |
list(, $page, $method) = $matches;
|
|
|
392 |
} else if ( preg_match( "#^(.*)$#", $_REQUEST['wiki'], $matches ) ) {
|
|
|
393 |
list(, $page) = $matches;
|
|
|
394 |
}
|
581 |
ddelon |
395 |
|
545 |
ddelon |
396 |
// Vérification de la méthode d'affichage employée!
|
|
|
397 |
if ( ! isset( $method ) ) {
|
|
|
398 |
$method = '';
|
|
|
399 |
}
|
581 |
ddelon |
400 |
|
545 |
ddelon |
401 |
//Récupération du contenu de la page Wikini
|
581 |
ddelon |
402 |
|
545 |
ddelon |
403 |
ob_start();
|
581 |
ddelon |
404 |
|
545 |
ddelon |
405 |
$server=$_SERVER['PHP_SELF'];
|
|
|
406 |
$_SERVER['PHP_SELF']="wakka.php";
|
581 |
ddelon |
407 |
|
545 |
ddelon |
408 |
$wiki->Run($page, $method);
|
581 |
ddelon |
409 |
|
545 |
ddelon |
410 |
$_SERVER['PHP_SELF']=$server;
|
581 |
ddelon |
411 |
|
545 |
ddelon |
412 |
$sortie.= ob_get_contents();
|
|
|
413 |
ob_end_clean();
|
|
|
414 |
|
|
|
415 |
$GLOBALS['_PAPYRUS_']['erreur']->setActive(1);
|
|
|
416 |
|
|
|
417 |
//return remplacerEntiteHTLM("<div id=\"wikini_page\" onLoad=\"thisForm=document.ACEditor;\" ondblclick=\"document.location='".$wiki->href("edit")."';"."\">"."\n".$sortie.'</div>'."\n");
|
581 |
ddelon |
418 |
return remplacerEntiteHTLM("<script type=\"text/javascript\" src=\"".IW_CHEMIN_BIBLIO_ACEDITOR."ACeditor.js\"></script><div id=\"wikini_page\" ondblclick=\"document.location='".$wiki->href("edit")."';"."\">"."\n".$sortie.'</div>'."\n");
|
|
|
419 |
|
545 |
ddelon |
420 |
}
|
|
|
421 |
|
|
|
422 |
?>
|