Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 180 → Rev 181

/trunk/papyrus/applications/afficheur/configuration/affi_configuration.inc.php
New file
0,0 → 1,99
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.3 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Papyrus. |
// | |
// | 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: affi_configuration.inc.php,v 1.1 2004-11-26 13:10:20 jpm Exp $
/**
* Application réalisant l'affichage du contenu stocké dans Papyrus.
*
* Les constantes et variables de configuration de l'application Afficheur.
*
*@package Afficheur
*@subpackage Configuration
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004-11-26 13:10:20 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
// Chemin des fichiers à inclure.
/** Chemin vers la bibliothèque PEAR.*/
define('AFFI_CHEMIN_BIBLIOTHEQUE_PEAR', '');
/** Chemin vers la bibliothèque API.*/
define('AFFI_CHEMIN_BIBLIOTHEQUE_API', GEN_CHEMIN_API);
/** Chaine à utiliser pour l'URL de la règle Freelink.*/
define('AFFI_URL_PAPYRUS', PAP_URL.'?menu=%s');
 
// L'objet PEAR::DB à utiliser pour l'afficheur :
$GLOBALS['_AFFICHEUR']['objet_pear_db'] = $GLOBALS['_GEN_commun']['pear_db'];
 
// L'identifiant du menu courant :
if (isset($GLOBALS['_GEN_commun']['traduction_info_menu'])) {
$GLOBALS['_AFFICHEUR']['menu_courant_id'] = $GLOBALS['_GEN_commun']['traduction_info_menu']->gm_id_menu;
} else {
$GLOBALS['_AFFICHEUR']['menu_courant_id'] = $GLOBALS['_GEN_commun']['info_menu']->gm_id_menu;
}
 
// Le jeu de caractère à utiliser pour la page courante :
$GLOBALS['_AFFICHEUR']['jeu_de_caracteres'] = $GLOBALS['_PAPYRUS_']['page']['jeu_de_caracteres'];
 
// Les sites correspodant aux liens interwiki:
$GLOBALS['_AFFICHEUR']['interwiki_sites'] = array(
'Papyrus' => 'http://127.0.0.1/papyrus/papyrus.php?menu=%s',
'Weflore' => 'http://wiki.tela-botanica.org/eflore/wakka.php?wiki=%s',
'Wikipedia' => 'http://fr.wikipedia.org/wiki/%s',
'Wikipedia_fr' => 'http://fr.wikipedia.org/wiki/%s'
);
 
// Les sites correspodant à l'action inclure:
$GLOBALS['_AFFICHEUR']['inclure_sites'] = array(
'Wikipedia' => array('preg' => '/<!-- start content -->(.*)<!-- end content -->/Umsi', 'url' => 'http://fr.wikipedia.org/wiki/%s'),
'Wikipedia_fr' => array('preg' => '/<!-- start content -->(.*)<!-- end content -->/Umsi', 'url' => 'http://fr.wikipedia.org/wiki/%s'),
'Wikipedia_en' => array('preg' => '/<!-- start content -->(.*)<!-- end content -->/Umsi', 'url' => 'http://en.wikipedia.org/wiki/%s'),
'Wikini_eFlore' => array('preg' => '/<div class="page">(.*)<\/div>.*<div class="commentsheader">/Umsi', 'url' => 'http://wiki.tela-botanica.org/eflore/wakka.php?wiki=%s'),
'Wikini_isff' => array('preg' => '/<div class="page">(.*)<\/div>.*<div class="commentsheader">/Umsi', 'url' => 'http://wiki.tela-botanica.org/isff/wakka.php?wiki=%s')
);
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/papyrus/applications/afficheur/afficheur.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: afficheur.php,v 1.1 2004-06-16 14:35:26 jpm Exp $
// CVS : $Id: afficheur.php,v 1.2 2004-11-26 13:10:05 jpm Exp $
/**
* Application réalisant l'affichage du contenu stocké dans Papyrus.
*
31,7 → 31,7
//Autres auteurs :
*@author Alexandre GRANIER <alexandrel@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2004-06-16 14:35:26 $
*@version $Revision: 1.2 $ $Date: 2004-11-26 13:10:05 $
// +------------------------------------------------------------------------------------------------------+
*/
 
38,13 → 38,14
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici les inclusions de fichiers*/
/** Inclusion du fichier de configuration de cette application.*/
require_once GEN_CHEMIN_PAP.'applications/afficheur/configuration/affi_configuration.inc.php';
/** Inclusion de la bibliothèque PEAR Text_Wiki.*/
require_once AFFI_CHEMIN_BIBLIOTHEQUE_PEAR.'Text/Wiki.php';
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici le code du programme*/
/** Fonction afficherContenuTete() - Fonction appelé par le gestionnaire Papyrus.
*
* Elle retourne l'entête de l'application..
66,27 → 67,59
{
//----------------------------------------------------------------------------
// Initialisation des variable
global $_GEN_commun;
$objet_pear_db = $_GEN_commun['pear_db'];
if (isset($_GEN_commun['traduction_info_menu'])) {
$id_menu_courant = $_GEN_commun['traduction_info_menu']->gm_id_menu;
} else {
$id_menu_courant = $_GEN_commun['info_menu']->gm_id_menu;
}
$retour = '';
//----------------------------------------------------------------------------
// Récupération du dernier contenu
$requete = 'SELECT gmc_contenu '.
$requete = 'SELECT gmc_contenu, gmc_ce_type_contenu '.
'FROM gen_menu_contenu '.
'WHERE gmc_ce_menu = '.$id_menu_courant.' '.
'WHERE gmc_ce_menu = '.$GLOBALS['_AFFICHEUR']['menu_courant_id'].' '.
'AND gmc_bool_dernier = 1';
$resultat = $objet_pear_db->query($requete);
$resultat = $GLOBALS['_AFFICHEUR']['objet_pear_db']->query($requete);
$ligne_contenu = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$retour = $ligne_contenu->gmc_contenu;
$contenu = $ligne_contenu->gmc_contenu;
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
/** Inclusion de la bibliothèque Text_Wiki_Papyrus.*/
include_once AFFI_CHEMIN_BIBLIOTHEQUE_API.'text_wiki_papyrus/Papyrus.class.php';
// Nous regardons si nous avons à faire à un texte sous format Wikini
if ($ligne_contenu->gmc_ce_type_contenu == 1) {
// Création d'un objet Text_Papyrus :
$papyrus =& new Text_Papyrus();
// Pour éviter de remplacer les caractères spéciaux du XHTML:
$papyrus->setFormatConf('Xhtml', 'translate', false);
// Pour indiquer le jeu de caractères (encodage) de la page courante :
$papyrus->setRenderConf('Xhtml', 'inclure', 'encodage', $GLOBALS['_AFFICHEUR']['jeu_de_caracteres']);
// Pour indiquer les infos sur les pages des sites à intégrer :
$papyrus->setRenderConf('Xhtml', 'inclure', 'sites', $GLOBALS['_AFFICHEUR']['inclure_sites']);
// Application des règles de Papyrus :
$retour = $papyrus->transform($contenu, 'Xhtml');
} else if ($ligne_contenu->gmc_ce_type_contenu == 2) {
include_once AFFI_CHEMIN_BIBLIOTHEQUE_API.'text_wiki_wikini/Wikini.class.php';
// Création d'un objet Text_Wikini :
$wikini =& new Text_Wikini();
// Pour éviter de remplacer les caractères spéciaux du XHTML:
$wikini->setFormatConf('Xhtml', 'translate', false);
// Configuration de la règle Freelink :
$wikini->setRenderConf('Xhtml', 'freelink', 'pages', null);
$wikini->setRenderConf('Xhtml', 'freelink', 'view_url', AFFI_URL_PAPYRUS);
// Configuration de la règle Interwiki :
$wikini->setRenderConf('Xhtml', 'interwiki', 'sites', $GLOBALS['_AFFICHEUR']['interwiki_sites']);
// Application des règles de Wikini :
$contenu = $wikini->transform($contenu, 'Xhtml');
// Création d'un objet Text_Papyrus :
$papyrus =& new Text_Papyrus();
// Pour éviter de remplacer les caractères spéciaux du XHTML:
$papyrus->setFormatConf('Xhtml', 'translate', false);
// Pour indiquer le jeu de caractères (encodage) de la page courante :
$papyrus->setRenderConf('Xhtml', 'inclure', 'encodage', $GLOBALS['_AFFICHEUR']['jeu_de_caracteres']);
// Pour indiquer les infos sur les pages des sites à intégrer :
$papyrus->setRenderConf('Xhtml', 'inclure', 'sites', $GLOBALS['_AFFICHEUR']['inclure_sites']);
// Application des règles de Papyrus :
$retour = $papyrus->transform($contenu, 'Xhtml');
}
//----------------------------------------------------------------------------
// Renvoie du contenu de la page
return $retour;
94,17 → 127,22
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
/*Mettre ici la liste de fonctions.*/
 
 
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/*Partie non obligatoire*/
 
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/06/16 14:35:26 jpm
* Changement de nom de Génésia en Papyrus.
* Changement de l'arborescence.
*
* Revision 1.12 2004/05/05 11:35:12 jpm
* Amélioration de la gestion de l'internationalisation.
*
117,5 → 155,4
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
 
?>