Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1372 Rev 1532
Line 27... Line 27...
27
// | de sécurité.                                                                                         |
27
// | de sécurité.                                                                                         |
28
// |                                                                                                      |
28
// |                                                                                                      |
29
// | Le fait que vous puissiez accéder à cet en-tête signifie que vous avez pris connaissance de la       |
29
// | Le fait que vous puissiez accéder à cet en-tête signifie que vous avez pris connaissance de la       |
30
// | licence CeCILL, et que vous en avez accepté les termes.                                              |
30
// | licence CeCILL, et que vous en avez accepté les termes.                                              |
31
// +------------------------------------------------------------------------------------------------------+
31
// +------------------------------------------------------------------------------------------------------+
32
// CVS : $Id: inclure.php,v 1.2 2006-12-08 15:57:30 jp_milcent Exp $
32
// CVS : $Id: inclure.php,v 1.2.2.1 2007-08-02 12:45:45 jp_milcent Exp $
33
/**
33
/**
34
* Applette : Inclure
34
* Applette : Inclure
35
*
35
*
36
* Retourne toutes les pages Papyrus appartenant à une catégorie donnée.
36
* Retourne toutes les pages Papyrus appartenant à une catégorie donnée.
37
*
37
*
Line 40... Line 40...
40
//Auteur original :
40
//Auteur original :
41
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
41
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
42
//Autres auteurs :
42
//Autres auteurs :
43
*@author        Aucun
43
*@author        Aucun
44
*@copyright     Tela-Botanica 2000-2006
44
*@copyright     Tela-Botanica 2000-2006
45
*@version       $Revision: 1.2 $ $Date: 2006-12-08 15:57:30 $
45
*@version       $Revision: 1.2.2.1 $ $Date: 2007-08-02 12:45:45 $
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
*/
47
*/
Line 48... Line 48...
48
 
48
 
49
// +------------------------------------------------------------------------------------------------------+
49
// +------------------------------------------------------------------------------------------------------+
Line 119... Line 119...
119
    $GLOBALS['_INCLURE_']['sortie'] = '';
119
    $GLOBALS['_INCLURE_']['sortie'] = '';
120
    if ($ok) {
120
    if ($ok) {
121
		$href = $GLOBALS['_INCLURE_']['site'][$options['interwiki']]['url'];
121
		$href = $GLOBALS['_INCLURE_']['site'][$options['interwiki']]['url'];
122
		$href = sprintf($href, $options['page']);
122
		$href = sprintf($href, $options['page']);
Line 123... Line -...
123
	    
-
 
124
	
123
	    
-
 
124
	    $contenu = file_get_contents($href);
125
	    $contenu = file_get_contents($href);
125
	    
126
	    if ($contenu != false) {
126
	    if ($contenu != false) {
127
		    $tab_matches = '';
127
		    $tab_matches = '';
128
		    preg_match($GLOBALS['_INCLURE_']['site'][$options['interwiki']]['preg'], $contenu, $tab_matches);
128
		    preg_match($GLOBALS['_INCLURE_']['site'][$options['interwiki']]['preg'], $contenu, $tab_matches);
129
		    $tab_encodage = '';
129
		    $tab_encodage = '';
130
		    preg_match('/<meta +http-equiv="Content-Type" +content="text\/html; *charset=(.+)"\/>/Ui', $contenu, $tab_encodage);
130
		    if (preg_match('/charset=(.+)"/Ui', $contenu, $tab_encodage) || preg_match('/encoding="(.+)"/Ui', $contenu, $tab_encodage)) {
131
		    if (preg_match('/^(?:iso-8859-1|iso-8859-15)$/i', $GLOBALS['_INCLURE_']['encodage']) && preg_match('/utf-8/i', $tab_encodage[1])) {
131
			    if (preg_match('/^(?:iso-8859-1|iso-8859-15)$/i', $GLOBALS['_INCLURE_']['encodage']) && preg_match('/utf-8/i', $tab_encodage[1])) {
-
 
132
			        $GLOBALS['_INCLURE_']['sortie'] = utf8_decode($tab_matches[1]);
-
 
133
			    } else {
-
 
134
			        $GLOBALS['_INCLURE_']['sortie'] = $tab_matches[1];
132
		        $GLOBALS['_INCLURE_']['sortie'] = utf8_decode($tab_matches[1]);
135
			    }
133
		    } else {
136
		    } else {
134
		        $GLOBALS['_INCLURE_']['sortie'] = $tab_matches[1];
137
		    	$GLOBALS['_INCLURE_']['informations'][] = sprintf(CATEG_LG_ERREUR_ENCODAGE, $href);
135
		    }
138
		    }
136
	    } else {
139
	    } else {
137
	    	$GLOBALS['_INCLURE_']['informations'][] = sprintf(CATEG_LG_ERREUR_INCLUSION, $href);
140
	    	$GLOBALS['_INCLURE_']['informations'][] = sprintf(CATEG_LG_ERREUR_INCLUSION, $href);
138
	    }
141
	    }
Line 157... Line 160...
157
}
160
}
Line 158... Line 161...
158
 
161
 
159
/* +--Fin du code ----------------------------------------------------------------------------------------+
162
/* +--Fin du code ----------------------------------------------------------------------------------------+
160
*
163
*
-
 
164
* $Log: not supported by cvs2svn $
-
 
165
* Revision 1.2  2006-12-08 15:57:30  jp_milcent
-
 
166
* Amélioration de la gestion du débogage de l'applette inclure.
161
* $Log: not supported by cvs2svn $
167
*
162
* Revision 1.1  2006/12/01 17:36:28  florian
168
* Revision 1.1  2006/12/01 17:36:28  florian
163
* Ajout de l'apllette Inclure, provenant de l'action Inclure.
169
* Ajout de l'apllette Inclure, provenant de l'action Inclure.
164
*
170
*
165
*
171
*