Subversion Repositories Sites.tela-botanica.org

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1091 gduche 1
<?php
2
function pap_analyseur_analyser($texte)	{
3
	/*
4
	 * Attention : ne fonctionne pas avec les balises meta
5
	 */
6
 
7
	global $chemin_papyrus;
8
 
9
	define(GEN_CHEMIN_APPLETTE, $chemin_papyrus.'papyrus/applettes/');
10
	//Inclusions des fichier de configuration de papyrus
11
 
12
	include_once $chemin_papyrus.'papyrus/configuration/pap_config.inc.php' ;
13
	include_once $chemin_papyrus.'papyrus/configuration/pap_config_avancee.inc.php' ;
14
 
15
                                                get_include_path().PATH_SEPARATOR;
16
	set_include_path($_SERVER['DOCUMENT_ROOT'].PATH_SEPARATOR.PAP_CHEMIN_API_PEAR.PATH_SEPARATOR.
17
						get_include_path().PATH_SEPARATOR);
18
 
19
 
20
	$GLOBALS['_GEN_commun']['info_site']->gs_fichier_squelette ="D:/greg/workspace/papyrus/actu/plugins/analyseur_papyrus/squelette.html";
21
	$GLOBALS['_GEN_commun']['info_site']->gs_ce_auth = 1;
22
 
23
	global $db, $_GEN_commun;
24
 
25
	//Inclusions des fichiers papyrus
26
	include_once $chemin_papyrus.'papyrus/pap_connecte_bdd.inc.php';
27
	include_once $chemin_papyrus.'papyrus/pap_initialise_auth.inc.php';
28
	include_once $chemin_papyrus.'papyrus/pap_initialise_info.inc.php';
29
	include_once $chemin_papyrus.'papyrus/bibliotheque/classes/pap_rendu.class.php';
30
	include_once $chemin_papyrus.'papyrus/bibliotheque/fonctions/pap_script.fonct.php';
31
	$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'] = $texte;
32
 
33
	//Informations du site
34
	//Récupéré depuis pap_rendu.inc.php
35
 
36
	$id_langue = $GLOBALS['_GEN_commun']['i18n'];
37
	$langue_test = (isset($id_langue) && $id_langue!='') ? $id_langue : GEN_I18N_ID_DEFAUT;
38
 
39
	$requete =  'SELECT * '.
40
                'FROM gen_site '.
41
                'WHERE gs_ce_i18n = "'.$langue_test.'" '.
42
                'AND gs_code_num = "'.$GLOBALS['_GEN_commun']['info_site']->gs_code_num.'"';
43
    $resultat = $db->query($requete);
44
    (DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
45
 
46
    $type_site = isset($GLOBALS['_GEN_commun']['traduction_info_site']) ? 'traduction_info_site' : 'info_site';
47
	$type_menu = isset($GLOBALS['_GEN_commun']['traduction_info_menu']) ? 'traduction_info_menu' : $type_menu='info_menu';
48
 
49
    // Construction des infos sur le site
50
	$GLOBALS['_PAPYRUS_']['page']['nom_site'] = htmlentities($GLOBALS['_GEN_commun'][$type_site]->gs_nom);
51
	$GLOBALS['_PAPYRUS_']['rendu']['SITE_NOM'] = $GLOBALS['_PAPYRUS_']['page']['nom_site'];
52
	$GLOBALS['_PAPYRUS_']['page']['langue_site'] = htmlentities($GLOBALS['_GEN_commun']['i18n']);
53
	$GLOBALS['_PAPYRUS_']['rendu']['SITE_LANGUE'] = $GLOBALS['_PAPYRUS_']['page']['langue_site'];
54
	$GLOBALS['_PAPYRUS_']['page']['code_alpha_site'] = htmlentities($GLOBALS['_GEN_commun'][$type_site]->gs_code_alpha);
55
	$GLOBALS['_PAPYRUS_']['rendu']['SITE_CODE_ALPHA'] = $GLOBALS['_PAPYRUS_']['page']['code_alpha_site'];
56
 
57
	// Construction des infos sur le menu pour générer les balises
58
	$GLOBALS['_PAPYRUS_']['rendu']['INFO_MENU_ID'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_id_menu);
59
	$GLOBALS['_PAPYRUS_']['rendu']['INFO_MENU_CODE_ALPHA'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_code_alpha);
60
	$GLOBALS['_PAPYRUS_']['rendu']['INFO_MENU_CODE_NUM'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_code_num);
61
 
62
	//Préfixe
63
	$GLOBALS['_GEN_commun']['balise_prefixe'] = 'PAPYRUS_';
64
	foreach ($GLOBALS['_PAPYRUS_']['rendu'] as $GLOBALS['_PAPYRUS_']['tmp']['cle'] => $GLOBALS['_PAPYRUS_']['tmp']['val']) {
65
		$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'] =
66
                    str_replace(   '<!-- '.$_GEN_commun['balise_prefixe'].$GLOBALS['_PAPYRUS_']['tmp']['cle'].' -->',
67
                                    $GLOBALS['_PAPYRUS_']['tmp']['val'],
68
                                    $GLOBALS['_PAPYRUS_']['general']['contenu_squelette']);
69
	}
70
 
71
	$pap_rendu = new Pap_Rendu();
72
	$pap_rendu->parserBaliseApplette($texte, true);
73
	if ($pap_rendu->getBoolBaliseAppli()) {
74
		$pap_rendu->remplacerBaliseApplette();
75
	}
76
	return $GLOBALS['_PAPYRUS_']['general']['contenu_squelette'];
77
}
78
?>