source: trunk/spip/esqueleto-redcta/plugins/article_pdf/article_pdf_mes_fonctions.php @ 30

Last change on this file since 30 was 30, checked in by sebas, 17 years ago

nueva importacion del codigo del esqueleto de redcta con los plugins

File size: 1.1 KB
Line 
1<?php
2        $p = explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(__FILE__))));
3        define('_DIR_PLUGIN_ARTICLE_PDF',(_DIR_PLUGINS.end($p)));
4
5        function pdf_first_clean($texte)
6        {
7                        // $texte = ereg_replace("<p class[^>]*>", "<P>", $texte);
8                        //Translation des codes iso
9                        // PB avec l'utilisation de <code>
10                        $trans = get_html_translation_table(HTML_ENTITIES);
11                        $trans = array_flip($trans);
12                        $trans["<br />\n"] = "<BR>";        // Pour éviter que le \n ne se tranforme en espace dans les <DIV class=spip_code> (TT, tag SPIP : code)
13                        $trans['&#176;'] = "°";
14                        $trans["&#339;"] = "oe";
15                        $trans["&#8211;"] = "-";
16                        $trans["&#8216;"] = "'";
17                        $trans["&#8217;"] = "'";               
18                        $trans["&#8220;"] = "\"";
19                        $trans["&#8221;"] = "\"";
20                        $trans["&#8230;"] = "...";
21                        $trans["&#8364;"] = "Euros";
22                        $trans["&ucirc;"] = "û";
23                        $trans['->'] = '-»';
24                        $trans['<-'] = '«-';
25                        $trans['&nbsp;'] = ' ';
26                        $texte = strtr($texte, $trans);
27                       
28                        $texte = unicode2charset(charset2unicode($texte), 'iso-8859-1'); // repasser tout dans un charset acceptable par export PDF
29       
30                        return $texte;
31        }
32
33
34?>
Note: See TracBrowser for help on using the repository browser.