433 |
ddelon |
1 |
<?php
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
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 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
24 |
// CVS : $Id: integrateur_wikini.php,v 1.1 2005-08-18 10:20:07 ddelon Exp $
|
|
|
25 |
/**
|
|
|
26 |
* 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 Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
33 |
//Autres auteurs :
|
|
|
34 |
*@author Aucun
|
|
|
35 |
*@copyright Tela-Botanica 2000-2004
|
|
|
36 |
*@version $Revision: 1.1 $ $Date: 2005-08-18 10:20:07 $
|
|
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
38 |
*/
|
|
|
39 |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
// | ENTETE du PROGRAMME |
|
|
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
43 |
/** Inclusion de la classe PEAR de gestion des URL. */
|
|
|
44 |
require_once 'Net/URL.php';
|
|
|
45 |
/** Inclusion du fichier de configuration général de IntegrateurWikini.*/
|
|
|
46 |
require_once 'client'.GEN_SEP.'integrateur_wikini'.GEN_SEP.'configuration'.GEN_SEP.'iw_config.inc.php';
|
|
|
47 |
|
|
|
48 |
/** Inclusion du fichier permettant d'encoder du texte mais pas les balises XHTML.*/
|
|
|
49 |
require_once IW_CHEMIN_BIBLIO.'iw_encodage.fonct.php';
|
|
|
50 |
/** Inclusion du fichier permettant d'inclure les données dans du XHTML.*/
|
|
|
51 |
require_once IW_CHEMIN_BIBLIO.'iw_affichage_xhtml.fonct.php';
|
|
|
52 |
|
|
|
53 |
/** Inclusion du fichier permettant l'utilisation de la classe wiki.*/
|
|
|
54 |
require_once IW_CHEMIN_BIBLIO_WIKINI.'wakka.php';
|
|
|
55 |
|
|
|
56 |
// Appel du fichier de traduction des textes de l'application Integrateur Wikini
|
|
|
57 |
if (file_exists(IW_CHEMIN_LANGUES.'iw_langue_'.IW_I18N.'.inc.php')) {
|
|
|
58 |
/** Inclusion du fichier de traduction de l'application Integrateur Wikini. */
|
|
|
59 |
include_once IW_CHEMIN_LANGUES.'iw_langue_'.IW_I18N.'.inc.php';
|
|
|
60 |
} else {
|
|
|
61 |
/** Inclusion du fichier de traduction fr par défaut. */
|
|
|
62 |
include_once IW_CHEMIN_LANGUES.'iw_langue_fr.inc.php';
|
|
|
63 |
}
|
|
|
64 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
65 |
// | CORPS du PROGRAMME |
|
|
|
66 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
67 |
/** Fonction afficherContenuCorps() - Fonction appelé par le gestionnaire Papyrus.
|
|
|
68 |
*
|
|
|
69 |
* Elle retourne le contenu de l'application.
|
|
|
70 |
*
|
|
|
71 |
* @return string du code XHTML correspondant au contenu renvoyé par l'application.
|
|
|
72 |
*/
|
|
|
73 |
function afficherContenuCorps()
|
|
|
74 |
{
|
|
|
75 |
$wakkaConfig = $GLOBALS['wikini_config_defaut'];
|
|
|
76 |
|
|
|
77 |
// Démarrage de session php
|
|
|
78 |
//session_start();
|
|
|
79 |
|
|
|
80 |
// Récupération du nom de la page wikini recherchée
|
|
|
81 |
if ( ! isset( $_REQUEST['wiki'] ) ) {
|
|
|
82 |
$GLOBALS['wiki'] = $GLOBALS['_GEN_commun']['info_application']->page;
|
|
|
83 |
} else {
|
|
|
84 |
$GLOBALS['wiki'] = $_REQUEST['wiki'];
|
|
|
85 |
}
|
|
|
86 |
|
|
|
87 |
// Gestion de la variable de session "linktracking"
|
|
|
88 |
if ( ! isset( $_SESSION['linktracking'] ) ) {
|
|
|
89 |
$_SESSION['linktracking'] = 1;
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
// Suppression des slash.
|
|
|
93 |
$wiki = preg_replace("/^\//", '', $GLOBALS['wiki']);
|
|
|
94 |
|
|
|
95 |
// split into page/method
|
|
|
96 |
if ( preg_match( "#^(.+?)/(.*)$#", $GLOBALS['wiki'], $matches ) ) {
|
|
|
97 |
list(, $page, $method) = $matches;
|
|
|
98 |
} else if ( preg_match( "#^(.*)$#", $GLOBALS['wiki'], $matches ) ) {
|
|
|
99 |
list(, $page) = $matches;
|
|
|
100 |
}
|
|
|
101 |
|
|
|
102 |
// Création de l'objet Wiki
|
|
|
103 |
$GLOBALS['wiki'] = new Wiki( $GLOBALS['wikini_config_defaut'] );
|
|
|
104 |
|
|
|
105 |
// Vérification de la méthode d'affichage employée!
|
|
|
106 |
if ( ! isset( $method ) ) {
|
|
|
107 |
$method = '';
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
//Récupération du contenu de la page Wikini
|
|
|
111 |
$sortie = remplacerEntiteHTLM('<div id="wikini_page">'."\n".$GLOBALS['wiki']->Run($page, $method).'</div>'."\n");
|
|
|
112 |
|
|
|
113 |
return $sortie;
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
/** Fonction afficherContenuPied() - Fonction appelé par le gestionnaire Papyrus.
|
|
|
117 |
*
|
|
|
118 |
* Elle retourne le pied de l'application.
|
|
|
119 |
*
|
|
|
120 |
* @return string du code XHTML correspondant au pied renvoyé par l'application.
|
|
|
121 |
*/
|
|
|
122 |
function afficherContenuPied()
|
|
|
123 |
{
|
|
|
124 |
return inclusion_html('pied_page');
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
128 |
// | PIED du PROGRAMME |
|
|
|
129 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
134 |
*
|
|
|
135 |
* $Log: not supported by cvs2svn $
|
|
|
136 |
* Revision 1.3 2005/05/19 15:22:46 jpm
|
|
|
137 |
* Ajout du remplacement des & par des &
|
|
|
138 |
*
|
|
|
139 |
* Revision 1.2 2005/05/19 13:17:02 jpm
|
|
|
140 |
* Ajout d'une balise div pour encadre le contenu du wikini.
|
|
|
141 |
*
|
|
|
142 |
* Revision 1.1 2005/03/02 17:47:05 jpm
|
|
|
143 |
* Ajout des fichiers necessaires à l'intégrateur de wikini.
|
|
|
144 |
*
|
|
|
145 |
*
|
|
|
146 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
147 |
*/
|
|
|
148 |
?>
|