| 433 | ddelon | 1 | <?php
 | 
        
           |  |  | 2 | /*vim: set expandtab tabstop=4 shiftwidth=4: */
 | 
        
           |  |  | 3 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 4 | // | PHP version 4.3                                                                                      |
 | 
        
           |  |  | 5 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 6 | // | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org)                                         |
 | 
        
           |  |  | 7 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 8 | // | This file is part of eFlore-Chorologie.                                                              |
 | 
        
           |  |  | 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: iw_encodage.fonct.php,v 1.1 2005-08-18 10:20:09 ddelon Exp $
 | 
        
           |  |  | 25 | /**
 | 
        
           |  |  | 26 | * Fonctions manipulant les encodages
 | 
        
           |  |  | 27 | *
 | 
        
           |  |  | 28 | * Fichiers contenant des fonctions manipulant l'encodage.
 | 
        
           |  |  | 29 | *
 | 
        
           |  |  | 30 | *@package IntegrateurWikini
 | 
        
           |  |  | 31 | *@subpackage Fonctions
 | 
        
           |  |  | 32 | //Auteur original :
 | 
        
           |  |  | 33 | *@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
 | 
        
           |  |  | 34 | //Autres auteurs :
 | 
        
           |  |  | 35 | *@author        Aucun
 | 
        
           |  |  | 36 | *@copyright     Tela-Botanica 2000-2005
 | 
        
           |  |  | 37 | *@version       $Revision: 1.1 $ $Date: 2005-08-18 10:20:09 $
 | 
        
           |  |  | 38 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 39 | */
 | 
        
           |  |  | 40 |   | 
        
           |  |  | 41 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 42 | // |                                            LISTE DES FONCTIONS                                       |
 | 
        
           |  |  | 43 | // +------------------------------------------------------------------------------------------------------+
 | 
        
           |  |  | 44 |   | 
        
           |  |  | 45 | /**
 | 
        
           |  |  | 46 | * La fonction remplacerEntiteHTLM() remplace des caractères par les entités html.
 | 
        
           |  |  | 47 | *
 | 
        
           |  |  | 48 | * Cette fonction retourne un texte dans lequel touts les caractères correspondant
 | 
        
           |  |  | 49 | * à des entités html sont remplacés par la valeur de l'entité, à l'exception
 | 
        
           |  |  | 50 | * des caractères <, >, & et ".
 | 
        
           |  |  | 51 | * Cela permet de remplacer toutes les entités dans une chaine contenant du html.
 | 
        
           |  |  | 52 | *
 | 
        
           |  |  | 53 | *@param string la chaîne html à parsser.
 | 
        
           |  |  | 54 | *@return string contient la chaîne html avec les entités intégrées.
 | 
        
           |  |  | 55 | */
 | 
        
           |  |  | 56 |   | 
        
           |  |  | 57 | function remplacerEntiteHTLM($texte)
 | 
        
           |  |  | 58 | {
 | 
        
           |  |  | 59 |     $texte_retour = '';
 | 
        
           |  |  | 60 |     $tab_entites = get_html_translation_table(HTML_ENTITIES);
 | 
        
           |  |  | 61 |     unset($tab_entites['"']);
 | 
        
           |  |  | 62 |     unset($tab_entites['<']);
 | 
        
           |  |  | 63 |     unset($tab_entites['>']);
 | 
        
           |  |  | 64 |     unset($tab_entites['&']);
 | 
        
           |  |  | 65 |     $tab_entites[' & '] = ' & ';
 | 
        
           |  |  | 66 |     return strtr($texte, $tab_entites);
 | 
        
           |  |  | 67 | }
 | 
        
           |  |  | 68 |   | 
        
           |  |  | 69 | /* +--Fin du code ----------------------------------------------------------------------------------------+
 | 
        
           |  |  | 70 | *
 | 
        
           |  |  | 71 | * $Log: not supported by cvs2svn $
 | 
        
           |  |  | 72 | * Revision 1.2  2005/05/19 15:11:49  jpm
 | 
        
           |  |  | 73 | * Ajout du remplacement des & par des &
 | 
        
           |  |  | 74 | *
 | 
        
           |  |  | 75 | * Revision 1.1  2005/03/02 17:47:05  jpm
 | 
        
           |  |  | 76 | * Ajout des fichiers necessaires à l'intégrateur de wikini.
 | 
        
           |  |  | 77 | *
 | 
        
           |  |  | 78 | *
 | 
        
           |  |  | 79 | * +-- Fin du code ----------------------------------------------------------------------------------------+
 | 
        
           |  |  | 80 | */
 | 
        
           |  |  | 81 | ?>
 |