Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 432 → Rev 433

/trunk/client/integrateur_wikini/integrateur_wikini.php
New file
0,0 → 1,148
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Integrateur Wikini. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: integrateur_wikini.php,v 1.1 2005-08-18 10:20:07 ddelon Exp $
/**
* Integrateur de page Wikini
*
* Application permettant d'intégrer des pages wikini dans Papyrus.
*
*@package IntegrateurWikini
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2005-08-18 10:20:07 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion de la classe PEAR de gestion des URL. */
require_once 'Net/URL.php';
/** Inclusion du fichier de configuration général de IntegrateurWikini.*/
require_once 'client'.GEN_SEP.'integrateur_wikini'.GEN_SEP.'configuration'.GEN_SEP.'iw_config.inc.php';
 
/** Inclusion du fichier permettant d'encoder du texte mais pas les balises XHTML.*/
require_once IW_CHEMIN_BIBLIO.'iw_encodage.fonct.php';
/** Inclusion du fichier permettant d'inclure les données dans du XHTML.*/
require_once IW_CHEMIN_BIBLIO.'iw_affichage_xhtml.fonct.php';
 
/** Inclusion du fichier permettant l'utilisation de la classe wiki.*/
require_once IW_CHEMIN_BIBLIO_WIKINI.'wakka.php';
 
// Appel du fichier de traduction des textes de l'application Integrateur Wikini
if (file_exists(IW_CHEMIN_LANGUES.'iw_langue_'.IW_I18N.'.inc.php')) {
/** Inclusion du fichier de traduction de l'application Integrateur Wikini. */
include_once IW_CHEMIN_LANGUES.'iw_langue_'.IW_I18N.'.inc.php';
} else {
/** Inclusion du fichier de traduction fr par défaut. */
include_once IW_CHEMIN_LANGUES.'iw_langue_fr.inc.php';
}
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Fonction afficherContenuCorps() - Fonction appelé par le gestionnaire Papyrus.
*
* Elle retourne le contenu de l'application.
*
* @return string du code XHTML correspondant au contenu renvoyé par l'application.
*/
function afficherContenuCorps()
{
$wakkaConfig = $GLOBALS['wikini_config_defaut'];
// Démarrage de session php
//session_start();
// Récupération du nom de la page wikini recherchée
if ( ! isset( $_REQUEST['wiki'] ) ) {
$GLOBALS['wiki'] = $GLOBALS['_GEN_commun']['info_application']->page;
} else {
$GLOBALS['wiki'] = $_REQUEST['wiki'];
}
// Gestion de la variable de session "linktracking"
if ( ! isset( $_SESSION['linktracking'] ) ) {
$_SESSION['linktracking'] = 1;
}
// Suppression des slash.
$wiki = preg_replace("/^\//", '', $GLOBALS['wiki']);
// split into page/method
if ( preg_match( "#^(.+?)/(.*)$#", $GLOBALS['wiki'], $matches ) ) {
list(, $page, $method) = $matches;
} else if ( preg_match( "#^(.*)$#", $GLOBALS['wiki'], $matches ) ) {
list(, $page) = $matches;
}
// Création de l'objet Wiki
$GLOBALS['wiki'] = new Wiki( $GLOBALS['wikini_config_defaut'] );
// Vérification de la méthode d'affichage employée!
if ( ! isset( $method ) ) {
$method = '';
}
//Récupération du contenu de la page Wikini
$sortie = remplacerEntiteHTLM('<div id="wikini_page">'."\n".$GLOBALS['wiki']->Run($page, $method).'</div>'."\n");
return $sortie;
}
 
/** Fonction afficherContenuPied() - Fonction appelé par le gestionnaire Papyrus.
*
* Elle retourne le pied de l'application.
*
* @return string du code XHTML correspondant au pied renvoyé par l'application.
*/
function afficherContenuPied()
{
return inclusion_html('pied_page');
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/05/19 15:22:46 jpm
* Ajout du remplacement des & par des &amp;
*
* Revision 1.2 2005/05/19 13:17:02 jpm
* Ajout d'une balise div pour encadre le contenu du wikini.
*
* Revision 1.1 2005/03/02 17:47:05 jpm
* Ajout des fichiers necessaires à l'intégrateur de wikini.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>