Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: pap_rendu.inc.php,v 1.6 2004-11-15 17:40:21 jpm Exp $
|
22 |
// CVS : $Id: pap_rendu.inc.php,v 1.7 2004-11-24 18:33:29 jpm Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Rendu : programme traitant l'url demandée et retournant la page compressé au navigateur.
|
24 |
* Rendu : programme traitant l'url demandée et retournant la page compressé au navigateur.
|
25 |
*
|
25 |
*
|
26 |
* Ce programme contient la partie collectant les informations sur la page demandée par le navigateur client.
|
26 |
* Ce programme contient la partie collectant les informations sur la page demandée par le navigateur client.
|
27 |
* Elle vérifie que la page ne soit pas déjà présente en cache et la renvoie si elle est disponible.
|
27 |
* Elle vérifie que la page ne soit pas déjà présente en cache et la renvoie si elle est disponible.
|
Line 33... |
Line 33... |
33 |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr>
|
33 |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr>
|
34 |
//Autres auteurs :
|
34 |
//Autres auteurs :
|
35 |
*@author Alexandre GRANIER <alexadandre@tela-botanica.org>
|
35 |
*@author Alexandre GRANIER <alexadandre@tela-botanica.org>
|
36 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
36 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
37 |
*@copyright Tela-Botanica 2000-2004
|
37 |
*@copyright Tela-Botanica 2000-2004
|
38 |
*@version $Revision: 1.6 $ $Date: 2004-11-15 17:40:21 $
|
38 |
*@version $Revision: 1.7 $ $Date: 2004-11-24 18:33:29 $
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
*/
|
40 |
*/
|
Line 41... |
Line 41... |
41 |
|
41 |
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
Line 60... |
Line 60... |
60 |
// Recherche du squelette de la page demandée.
|
60 |
// Recherche du squelette de la page demandée.
|
Line 61... |
Line 61... |
61 |
|
61 |
|
62 |
// Ouverture du squelette
|
62 |
// Ouverture du squelette
|
63 |
if (empty($_GEN_commun['info_menu']->gm_fichier_squelette)) {
|
63 |
if (empty($_GEN_commun['info_menu']->gm_fichier_squelette)) {
|
64 |
if (isset($_GEN_commun['traduction_info_site'])) {
|
64 |
if (isset($_GEN_commun['traduction_info_site'])) {
|
65 |
$chemin_squelette = $_GEN_commun['traduction_info_site']->gs_fichier_squelette;
|
65 |
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $_GEN_commun['traduction_info_site']->gs_fichier_squelette;
|
66 |
} else {
|
66 |
} else {
|
67 |
$chemin_squelette = $_GEN_commun['info_site']->gs_fichier_squelette;
|
67 |
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $_GEN_commun['info_site']->gs_fichier_squelette;
|
68 |
}
|
68 |
}
|
69 |
} else {
|
69 |
} else {
|
70 |
if (isset($_GEN_commun['traduction_info_menu'])) {
|
70 |
if (isset($_GEN_commun['traduction_info_menu'])) {
|
71 |
$chemin_squelette = $_GEN_commun['traduction_info_menu']->gs_fichier_squelette;
|
71 |
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $_GEN_commun['traduction_info_menu']->gs_fichier_squelette;
|
72 |
} else {
|
72 |
} else {
|
73 |
$chemin_squelette = $_GEN_commun['info_menu']->gm_fichier_squelette;
|
73 |
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $_GEN_commun['info_menu']->gm_fichier_squelette;
|
74 |
}
|
74 |
}
|
75 |
}
|
75 |
}
|
76 |
// Si l'information concernant le chemin est réellement un chemin
|
76 |
// Si l'information concernant le chemin est réellement un chemin
|
77 |
if (! file_exists($chemin_squelette)) {
|
77 |
if (! file_exists($GLOBALS['_PAPYRUS_']['general']['chemin_squelette'])) {
|
78 |
//Si ce n'est qu'un nom de fichier squelette
|
78 |
//Si ce n'est qu'un nom de fichier squelette
|
79 |
$chemin_test = GEN_CHEMIN_SITES.
|
79 |
$GLOBALS['_PAPYRUS_']['general']['chemin_test'] = GEN_CHEMIN_SITES.
|
80 |
$_GEN_commun['info_site']->gs_code_alpha.'/'.
|
80 |
$_GEN_commun['info_site']->gs_code_alpha.'/'.
|
81 |
$_GEN_commun['i18n'].'/'.GEN_DOSSIER_SQUELETTE.'/'.$chemin_squelette;
|
81 |
$_GEN_commun['i18n'].'/'.GEN_DOSSIER_SQUELETTE.'/'.$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'];
|
82 |
if (! file_exists($chemin_test)) {
|
82 |
if (! file_exists($GLOBALS['_PAPYRUS_']['general']['chemin_test'])) {
|
83 |
die('ERREUR Génésia : Impossible de trouver de fichier de squelette. <br />'.
|
83 |
die('ERREUR Papyrus : Impossible de trouver de fichier de squelette. <br />'.
|
84 |
'Chemin fichier squelette : '.$chemin_squelette.' <br />'.
|
84 |
'Chemin fichier squelette : '.$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'].' <br />'.
|
85 |
'Ligne n° : '. __LINE__ .'<br />'.
|
85 |
'Ligne n° : '. __LINE__ .'<br />'.
|
86 |
'Fichier : '. __FILE__ );
|
86 |
'Fichier : '. __FILE__ );
|
87 |
} else {
|
87 |
} else {
|
88 |
$chemin_squelette = $chemin_test;
|
88 |
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $GLOBALS['_PAPYRUS_']['general']['chemin_test'];
|
89 |
}
|
89 |
}
|
Line 90... |
Line 90... |
90 |
}
|
90 |
}
|
91 |
|
91 |
|
Line 98... |
Line 98... |
98 |
for ($i = 0; $i < count($tab_fichier_squelette); $i++) {
|
98 |
for ($i = 0; $i < count($tab_fichier_squelette); $i++) {
|
99 |
$contenu_squelette .= $tab_fichier_squelette[$i];
|
99 |
$contenu_squelette .= $tab_fichier_squelette[$i];
|
100 |
}
|
100 |
}
|
101 |
*/
|
101 |
*/
|
102 |
// Lecture du fichier de squelette XHTML en PHP 4.3
|
102 |
// Lecture du fichier de squelette XHTML en PHP 4.3
|
103 |
$contenu_squelette = file_get_contents($chemin_squelette);
|
103 |
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'] = file_get_contents($GLOBALS['_PAPYRUS_']['general']['chemin_squelette']);
|
Line 104... |
Line 104... |
104 |
|
104 |
|
105 |
|
105 |
|
Line 106... |
Line 106... |
106 |
// +------------------------------------------------------------------------------------------------------+
|
106 |
// +------------------------------------------------------------------------------------------------------+
|
107 |
// Recherche des informations pour la complétion de l'entête du squelette de la page demandée.
|
107 |
// Recherche des informations pour la complétion de l'entête du squelette de la page demandée.
|
108 |
|
108 |
|
109 |
// Construction du titre.
|
109 |
// Construction du titre.
|
110 |
if (! empty($_GEN_commun['info_menu']->gm_titre)) {
|
110 |
if (! empty($_GEN_commun['info_menu']->gm_titre)) {
|
111 |
$titre = htmlentities($_GEN_commun['info_menu']->gm_titre);
|
111 |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($_GEN_commun['info_menu']->gm_titre);
|
112 |
} else if (! empty($_GEN_commun['info_menu']->gm_titre_alternatif)) {
|
112 |
} else if (! empty($_GEN_commun['info_menu']->gm_titre_alternatif)) {
|
113 |
$titre = htmlentities($_GEN_commun['info_menu']->gm_titre_alternatif);
|
113 |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($_GEN_commun['info_menu']->gm_titre_alternatif);
|
- |
|
114 |
} else {
|
Line 114... |
Line 115... |
114 |
} else {
|
115 |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($_GEN_commun['info_menu']->gm_nom);
|
115 |
$titre = htmlentities($_GEN_commun['info_menu']->gm_nom);
|
116 |
}
|
- |
|
117 |
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $GLOBALS['_PAPYRUS_']['page']['titre'];
|
116 |
}
|
118 |
|
- |
|
119 |
// Construction des infos sur le site
|
117 |
|
120 |
$GLOBALS['_PAPYRUS_']['page']['nom_site'] = htmlentities($_GEN_commun['info_site']->gs_nom);
|
- |
|
121 |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_NOM'] = $GLOBALS['_PAPYRUS_']['page']['nom_site'];
|
Line 118... |
Line 122... |
118 |
// Construction des infos sur le site
|
122 |
$GLOBALS['_PAPYRUS_']['page']['langue_site'] = htmlentities($_GEN_commun['i18n']);
|
119 |
$nom_site = htmlentities($_GEN_commun['info_site']->gs_nom);
|
123 |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_LANGUE'] = $GLOBALS['_PAPYRUS_']['page']['langue_site'];
|
120 |
$langue_site = htmlentities($_GEN_commun['i18n']);
|
124 |
$GLOBALS['_PAPYRUS_']['page']['code_alpha_site'] = htmlentities($_GEN_commun['info_site']->gs_code_alpha);
|
- |
|
125 |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_CODE_ALPHA'] = $GLOBALS['_PAPYRUS_']['page']['code_alpha_site'];
|
121 |
$code_alpha_site = htmlentities($_GEN_commun['info_site']->gs_code_alpha);
|
126 |
|
- |
|
127 |
// Construction des Meta "http-equiv".
|
122 |
|
128 |
$_GEN_commun['meta_http_equiv'] = array();
|
123 |
// Construction des Meta "http-equiv".
|
129 |
$GLOBALS['_PAPYRUS_']['page']['jeu_de_caracteres'] = htmlentities($_GEN_commun['info_i18n']->gi_jeu_de_caracteres);
|
124 |
$_GEN_commun['meta_http_equiv'] = array();
|
130 |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_JEU_DE_CARACTERES'] = $GLOBALS['_PAPYRUS_']['page']['jeu_de_caracteres'];
|
125 |
$jeu_de_caracteres = htmlentities($_GEN_commun['info_i18n']->gi_jeu_de_caracteres);
|
131 |
$GLOBALS['_PAPYRUS_']['page']['langue'] = htmlentities($_GEN_commun['info_i18n_langue']->gil_id_langue);
|
Line 126... |
Line 132... |
126 |
$langue = htmlentities($_GEN_commun['info_i18n_langue']->gil_id_langue);
|
132 |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_LANGUE'] = $GLOBALS['_PAPYRUS_']['page']['langue'];
|
127 |
GEN_stockerMetaHttpEquiv('Content-Type', 'text/html; charset='.$jeu_de_caracteres);
|
133 |
GEN_stockerMetaHttpEquiv('Content-Type', 'text/html; charset='.$GLOBALS['_PAPYRUS_']['page']['jeu_de_caracteres']);
|
128 |
GEN_stockerMetaHttpEquiv('Content-style-type', 'text/css');
|
134 |
GEN_stockerMetaHttpEquiv('Content-style-type', 'text/css');
|
129 |
GEN_stockerMetaHttpEquiv('Content-script-type', 'text/javascript');
|
135 |
GEN_stockerMetaHttpEquiv('Content-script-type', 'text/javascript');
|
130 |
GEN_stockerMetaHttpEquiv('Content-language', $langue);
|
136 |
GEN_stockerMetaHttpEquiv('Content-language', $GLOBALS['_PAPYRUS_']['page']['langue']);
|
131 |
|
137 |
|
132 |
// Construction des Meta "name".
|
138 |
// Construction des Meta "name".
|
133 |
$_GEN_commun['meta_name'] = array();
|
139 |
$_GEN_commun['meta_name'] = array();
|
134 |
$robot = htmlentities($_GEN_commun['info_menu']->gm_robot);
|
140 |
$GLOBALS['_PAPYRUS_']['page']['robot'] = htmlentities($_GEN_commun['info_menu']->gm_robot);
|
135 |
$auteur = htmlentities($_GEN_commun['info_menu']->gm_auteur);
|
141 |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($_GEN_commun['info_menu']->gm_auteur);
|
136 |
if (empty($auteur)) {
|
142 |
if (empty($pap_auteur)) {
|
137 |
$auteur = htmlentities($_GEN_commun['info_site']->gs_auteur);
|
143 |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($_GEN_commun['info_site']->gs_auteur);
|
138 |
}
|
144 |
}
|
139 |
$mots_cles = htmlentities($_GEN_commun['info_menu']->gm_mots_cles);
|
145 |
$GLOBALS['_PAPYRUS_']['page']['mots_cles'] = htmlentities($_GEN_commun['info_menu']->gm_mots_cles);
|
140 |
if (empty($mots_cles)) {
|
146 |
if (empty($GLOBALS['_PAPYRUS_']['page']['mots_cles'])) {
|
141 |
$auteur = htmlentities($_GEN_commun['info_site']->gs_mots_cles);
|
147 |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($_GEN_commun['info_site']->gs_mots_cles);
|
142 |
}
|
148 |
}
|
143 |
$description_libre = htmlentities($_GEN_commun['info_menu']->gm_description_libre);
|
149 |
$GLOBALS['_PAPYRUS_']['page']['description_libre'] = htmlentities($_GEN_commun['info_menu']->gm_description_libre);
|
144 |
if (empty($description_libre)) {
|
150 |
if (empty($pap_description_libre)) {
|
145 |
$description_libre = htmlentities($_GEN_commun['info_site']->gs_description);
|
151 |
$GLOBALS['_PAPYRUS_']['page']['description_libre'] = htmlentities($_GEN_commun['info_site']->gs_description);
|
Line 146... |
Line 152... |
146 |
}
|
152 |
}
|
147 |
GEN_stockerMetaName('revisit-after', '15 days');
|
153 |
GEN_stockerMetaName('revisit-after', '15 days');
|
148 |
GEN_stockerMetaName('robots', $robot);
|
154 |
GEN_stockerMetaName('robots', $GLOBALS['_PAPYRUS_']['page']['robot']);
|
149 |
GEN_stockerMetaName('author', $auteur);
|
155 |
GEN_stockerMetaName('author', $GLOBALS['_PAPYRUS_']['page']['auteur']);
|
150 |
GEN_stockerMetaName('keywords', $mots_cles);
|
156 |
GEN_stockerMetaName('keywords', $GLOBALS['_PAPYRUS_']['page']['mots_cles']);
|
151 |
GEN_stockerMetaName('description', $description_libre);
|
157 |
GEN_stockerMetaName('description', $GLOBALS['_PAPYRUS_']['page']['description_libre']);
|
152 |
|
158 |
|
153 |
// Construction des Meta Meta "name" du Dublin Core.
|
159 |
// Construction des Meta Meta "name" du Dublin Core.
|
154 |
$titre_alternatif = htmlentities($_GEN_commun['info_menu']->gm_titre_alternatif);
|
160 |
$GLOBALS['_PAPYRUS_']['page']['titre_alternatif'] = htmlentities($_GEN_commun['info_menu']->gm_titre_alternatif);
|
155 |
$auteur = htmlentities($_GEN_commun['info_menu']->gm_auteur);
|
161 |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($_GEN_commun['info_menu']->gm_auteur);
|
156 |
$description_resume = htmlentities($_GEN_commun['info_menu']->gm_description_resume);
|
162 |
$GLOBALS['_PAPYRUS_']['page']['description_resume'] = htmlentities($_GEN_commun['info_menu']->gm_description_resume);
|
157 |
$description_table_matieres = htmlentities($_GEN_commun['info_menu']->gm_description_table_matieres);
|
163 |
$GLOBALS['_PAPYRUS_']['page']['description_table_matieres'] = htmlentities($_GEN_commun['info_menu']->gm_description_table_matieres);
|
158 |
$publieur = htmlentities($_GEN_commun['info_menu']->gm_editeur);
|
164 |
$GLOBALS['_PAPYRUS_']['page']['publieur'] = htmlentities($_GEN_commun['info_menu']->gm_editeur);
|
159 |
$contributeur = htmlentities($_GEN_commun['info_menu']->gm_contributeur);
|
165 |
$GLOBALS['_PAPYRUS_']['page']['contributeur'] = htmlentities($_GEN_commun['info_menu']->gm_contributeur);
|
160 |
$date_creation = htmlentities($_GEN_commun['info_menu']->gm_date_creation);
|
166 |
$GLOBALS['_PAPYRUS_']['page']['date_creation'] = htmlentities($_GEN_commun['info_menu']->gm_date_creation);
|
161 |
$date_soumission = htmlentities($_GEN_commun['info_menu']->gm_date_soumission);
|
167 |
$GLOBALS['_PAPYRUS_']['page']['date_soumission'] = htmlentities($_GEN_commun['info_menu']->gm_date_soumission);
|
162 |
$date_acceptation = htmlentities($_GEN_commun['info_menu']->gm_date_acceptation);
|
168 |
$GLOBALS['_PAPYRUS_']['page']['date_acceptation'] = htmlentities($_GEN_commun['info_menu']->gm_date_acceptation);
|
163 |
$periode_validite = htmlentities($_GEN_commun['info_menu']->gm_date_debut_validite);
|
169 |
$GLOBALS['_PAPYRUS_']['page']['periode_validite'] = htmlentities($_GEN_commun['info_menu']->gm_date_debut_validite);
|
164 |
$date_copyright = htmlentities($_GEN_commun['info_menu']->gm_date_copyright);
|
170 |
$GLOBALS['_PAPYRUS_']['page']['date_copyright'] = htmlentities($_GEN_commun['info_menu']->gm_date_copyright);
|
165 |
$source = htmlentities($_GEN_commun['info_menu']->gm_source);
|
171 |
$GLOBALS['_PAPYRUS_']['page']['source'] = htmlentities($_GEN_commun['info_menu']->gm_source);
|
166 |
$langue_rfc_3066 = $langue.'-'.htmlentities($_GEN_commun['info_i18n_pays']->gip_id_pays);
|
172 |
$GLOBALS['_PAPYRUS_']['page']['langue_rfc_3066'] = $GLOBALS['_PAPYRUS_']['page']['langue'].'-'.htmlentities($_GEN_commun['info_i18n_pays']->gip_id_pays);
|
167 |
$type_portee_spatiale = htmlentities($_GEN_commun['info_menu']->gm_ce_type_portee_spatiale);
|
173 |
$GLOBALS['_PAPYRUS_']['page']['type_portee_spatiale'] = htmlentities($_GEN_commun['info_menu']->gm_ce_type_portee_spatiale);
|
168 |
$portee_spatiale = htmlentities($_GEN_commun['info_menu']->gm_portee_spatiale);
|
174 |
$GLOBALS['_PAPYRUS_']['page']['portee_spatiale'] = htmlentities($_GEN_commun['info_menu']->gm_portee_spatiale);
|
169 |
$type_portee_temporelle = htmlentities($_GEN_commun['info_menu']->gm_ce_type_portee_temporelle);
|
175 |
$GLOBALS['_PAPYRUS_']['page']['type_portee_temporelle'] = htmlentities($_GEN_commun['info_menu']->gm_ce_type_portee_temporelle);
|
170 |
$portee_temporelle = htmlentities($_GEN_commun['info_menu']->gm_portee_temporelle);
|
176 |
$GLOBALS['_PAPYRUS_']['page']['portee_temporelle'] = htmlentities($_GEN_commun['info_menu']->gm_portee_temporelle);
|
171 |
$licence = htmlentities($_GEN_commun['info_menu']->gm_licence);
|
177 |
$GLOBALS['_PAPYRUS_']['page']['licence'] = htmlentities($_GEN_commun['info_menu']->gm_licence);
|
172 |
$public = htmlentities($_GEN_commun['info_menu']->gm_public);
|
178 |
$GLOBALS['_PAPYRUS_']['page']['public'] = htmlentities($_GEN_commun['info_menu']->gm_public);
|
173 |
$public_niveau = htmlentities($_GEN_commun['info_menu']->gm_public_niveau);
|
179 |
$GLOBALS['_PAPYRUS_']['page']['public_niveau'] = htmlentities($_GEN_commun['info_menu']->gm_public_niveau);
|
174 |
GEN_stockerMetaNameDC('DC.Title', $titre, $langue);
|
180 |
GEN_stockerMetaNameDC('DC.Title', $GLOBALS['_PAPYRUS_']['page']['titre'], $GLOBALS['_PAPYRUS_']['page']['langue']);
|
175 |
GEN_stockerMetaNameDC('DC.Title.alternative', $titre_alternatif, $langue);
|
181 |
GEN_stockerMetaNameDC('DC.Title.alternative', $GLOBALS['_PAPYRUS_']['page']['titre_alternatif'], $GLOBALS['_PAPYRUS_']['page']['langue']);
|
176 |
GEN_stockerMetaNameDC('DC.Creator', $auteur);
|
182 |
GEN_stockerMetaNameDC('DC.Creator', $GLOBALS['_PAPYRUS_']['page']['auteur']);
|
177 |
GEN_stockerMetaNameDC('DC.Subject', $mots_cles, $langue);
|
183 |
GEN_stockerMetaNameDC('DC.Subject', $GLOBALS['_PAPYRUS_']['page']['mots_cles'], $GLOBALS['_PAPYRUS_']['page']['langue']);
|
178 |
GEN_stockerMetaNameDC('DC.Description', $description_libre, $langue);
|
184 |
GEN_stockerMetaNameDC('DC.Description', $GLOBALS['_PAPYRUS_']['page']['description_libre'], $GLOBALS['_PAPYRUS_']['page']['langue']);
|
179 |
GEN_stockerMetaNameDC('DC.Description.abstract', $description_resume, $langue);
|
185 |
GEN_stockerMetaNameDC('DC.Description.abstract', $GLOBALS['_PAPYRUS_']['page']['description_resume'], $GLOBALS['_PAPYRUS_']['page']['langue']);
|
180 |
GEN_stockerMetaNameDC('DC.Description.tableOfContents', $description_table_matieres, $langue);
|
186 |
GEN_stockerMetaNameDC('DC.Description.tableOfContents', $GLOBALS['_PAPYRUS_']['page']['description_table_matieres'], $GLOBALS['_PAPYRUS_']['page']['langue']);
|
181 |
GEN_stockerMetaNameDC('DC.Publisher', $publieur);
|
187 |
GEN_stockerMetaNameDC('DC.Publisher', $GLOBALS['_PAPYRUS_']['page']['publieur']);
|
182 |
GEN_stockerMetaNameDC('DC.Contributor', $contributeur);
|
188 |
GEN_stockerMetaNameDC('DC.Contributor', $GLOBALS['_PAPYRUS_']['page']['contributeur']);
|
183 |
GEN_stockerMetaNameDC('DC.Date.created', $date_creation, '', 'W3CDTF');
|
189 |
GEN_stockerMetaNameDC('DC.Date.created', $GLOBALS['_PAPYRUS_']['page']['date_creation'], '', 'W3CDTF');
|
184 |
GEN_stockerMetaNameDC('DC.Date.valid', $periode_validite, '', 'W3CDTF');
|
190 |
GEN_stockerMetaNameDC('DC.Date.valid', $GLOBALS['_PAPYRUS_']['page']['periode_validite'], '', 'W3CDTF');
|
185 |
//Ajouter la gestion des dates valid et available en utilisant les dates de la table gen_page_contenu.
|
191 |
//Ajouter la gestion des dates valid et available en utilisant les dates de la table gen_page_contenu.
|
186 |
GEN_stockerMetaNameDC('DC.Date.dateSubmitted', $date_soumission, '', 'W3CDTF');
|
192 |
GEN_stockerMetaNameDC('DC.Date.dateSubmitted', $GLOBALS['_PAPYRUS_']['page']['date_soumission'], '', 'W3CDTF');
|
187 |
GEN_stockerMetaNameDC('DC.Date.dateCopyrighted', $date_copyright, '', 'W3CDTF');
|
193 |
GEN_stockerMetaNameDC('DC.Date.dateCopyrighted', $GLOBALS['_PAPYRUS_']['page']['date_copyright'], '', 'W3CDTF');
|
188 |
GEN_stockerMetaNameDC('DC.Date.dateAccepted', $date_acceptation, '', 'W3CDTF');
|
194 |
GEN_stockerMetaNameDC('DC.Date.dateAccepted', $GLOBALS['_PAPYRUS_']['page']['date_acceptation'], '', 'W3CDTF');
|
Line 189... |
Line 195... |
189 |
GEN_stockerMetaNameDC('DC.Source', $source, '', 'URI');
|
195 |
GEN_stockerMetaNameDC('DC.Source', $GLOBALS['_PAPYRUS_']['page']['source'], '', 'URI');
|
190 |
GEN_stockerMetaNameDC('DC.Language', $langue_rfc_3066, '', 'RFC3066');
|
196 |
GEN_stockerMetaNameDC('DC.Language', $GLOBALS['_PAPYRUS_']['page']['langue_rfc_3066'], '', 'RFC3066');
|
191 |
GEN_stockerMetaNameDC('DC.Coverage.spatial', $portee_spatiale, '', $type_portee_spatiale);
|
197 |
GEN_stockerMetaNameDC('DC.Coverage.spatial', $GLOBALS['_PAPYRUS_']['page']['portee_spatiale'], '', $GLOBALS['_PAPYRUS_']['page']['type_portee_spatiale']);
|
192 |
GEN_stockerMetaNameDC('DC.Coverage.temporal', $portee_temporelle, '', $type_portee_temporelle);
|
198 |
GEN_stockerMetaNameDC('DC.Coverage.temporal', $GLOBALS['_PAPYRUS_']['page']['portee_temporelle'], '', $GLOBALS['_PAPYRUS_']['page']['type_portee_temporelle']);
|
Line 222... |
Line 228... |
222 |
// de l'application pour permettre à l'appli de modifier certains paramêtres (identification, ordre des menus).
|
228 |
// de l'application pour permettre à l'appli de modifier certains paramêtres (identification, ordre des menus).
|
223 |
$_GEN_commun['info_applette'][$i]->applette_balise = $_GEN_commun['info_applette_balise'];
|
229 |
$_GEN_commun['info_applette'][$i]->applette_balise = $_GEN_commun['info_applette_balise'];
|
224 |
$_GEN_commun['info_applette'][$i]->applette_fonction = $_GEN_commun['info_applette_nom_fonction'];
|
230 |
$_GEN_commun['info_applette'][$i]->applette_fonction = $_GEN_commun['info_applette_nom_fonction'];
|
225 |
} else {
|
231 |
} else {
|
226 |
// Ne devrait pas arréter le programme! Mais instancier le gestionnaire de déboguage.
|
232 |
// Ne devrait pas arréter le programme! Mais instancier le gestionnaire de déboguage.
|
227 |
die('ERREUR Génésia : Impossible de trouver le fichier de l\'applette. <br />'.
|
233 |
die('ERREUR Papyrus : Impossible de trouver le fichier de l\'applette. <br />'.
|
228 |
'Nom applette : '.$_GEN_commun['info_applette'][$i]->gap_nom.' <br />'.
|
234 |
'Nom applette : '.$_GEN_commun['info_applette'][$i]->gap_nom.' <br />'.
|
229 |
'Chemin fichier applette : '.$_GEN_commun['info_applette'][$i]->gap_chemin.' <br />'.
|
235 |
'Chemin fichier applette : '.$_GEN_commun['info_applette'][$i]->gap_chemin.' <br />'.
|
230 |
'Ligne n° : '. __LINE__ .'<br />'.
|
236 |
'Ligne n° : '. __LINE__ .'<br />'.
|
231 |
'Fichier : '. __FILE__ );
|
237 |
'Fichier : '. __FILE__ );
|
232 |
}
|
238 |
}
|
Line 235... |
Line 241... |
235 |
// +------------------------------------------------------------------------------------------------------+
|
241 |
// +------------------------------------------------------------------------------------------------------+
|
236 |
// Gestion de l'intégration de l'application liée au menu
|
242 |
// Gestion de l'intégration de l'application liée au menu
|
Line 237... |
Line 243... |
237 |
|
243 |
|
238 |
// Une fois les applettes appelées est executées nous appelons l'application qui peut avoir
|
244 |
// Une fois les applettes appelées est executées nous appelons l'application qui peut avoir
|
239 |
// besoins des infos des applettes (c'est le cas, pour l'applette IDENTIFICATION).
|
245 |
// besoins des infos des applettes (c'est le cas, pour l'applette IDENTIFICATION).
|
240 |
$application_chemin = '';
|
246 |
$GLOBALS['_PAPYRUS_']['general']['application_chemin'] = '';
|
241 |
if (isset($_GEN_commun['info_application']->gap_chemin)) {
|
247 |
if (isset($_GEN_commun['info_application']->gap_chemin)) {
|
242 |
$application_chemin = $_GEN_commun['info_application']->gap_chemin;
|
248 |
$GLOBALS['_PAPYRUS_']['general']['application_chemin'] = $_GEN_commun['info_application']->gap_chemin;
|
Line 243... |
Line 249... |
243 |
}
|
249 |
}
|
244 |
|
250 |
|
Line 245... |
Line 251... |
245 |
// $application_chemin contient le chemin de l'application
|
251 |
// $application_chemin contient le chemin de l'application
|
246 |
// Si $application_chemin est vide, on défini putFrame comme ne retournant rien.
|
252 |
// Si $application_chemin est vide, on défini putFrame comme ne retournant rien.
|
247 |
|
253 |
|
248 |
if (empty($application_chemin) ) {
|
254 |
if (empty($GLOBALS['_PAPYRUS_']['general']['application_chemin']) ) {
|
249 |
function afficherContenuCorps()
|
255 |
function afficherContenuCorps()
|
250 |
{
|
256 |
{
|
251 |
return '<p class="pap_erreur">'.'Pas d\'application.'.'</p>';
|
257 |
return '<p class="pap_erreur">'.'Pas d\'application.'.'</p>';
|
252 |
}
|
258 |
}
|
253 |
} else {
|
259 |
} else {
|
254 |
if (file_exists($application_chemin)) {
|
260 |
if (file_exists($GLOBALS['_PAPYRUS_']['general']['application_chemin'])) {
|
255 |
include_once($application_chemin);
|
261 |
include_once($GLOBALS['_PAPYRUS_']['general']['application_chemin']);
|
256 |
} else {
|
262 |
} else {
|
257 |
die('ERREUR Génésia : application impossible à charger. <br />'.
|
263 |
die('ERREUR Papyrus : application impossible à charger. <br />'.
|
258 |
'Chemin application : '.$application_chemin.' <br />'.
|
264 |
'Chemin application : '.$GLOBALS['_PAPYRUS_']['general']['application_chemin'].' <br />'.
|
259 |
'Ligne n° : '. __LINE__ .'<br />'.
|
265 |
'Ligne n° : '. __LINE__ .'<br />'.
|
Line 260... |
Line 266... |
260 |
'Fichier : '. __FILE__ );
|
266 |
'Fichier : '. __FILE__ );
|
261 |
}
|
267 |
}
|
Line 262... |
Line -... |
262 |
}
|
- |
|
263 |
|
- |
|
264 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
265 |
// Recherche des informations provenant de l'application pour la complétion du squelette
|
268 |
}
|
266 |
|
269 |
|
267 |
// Tableau associatif contenant les différentes parties du contenu à afficher
|
270 |
// +------------------------------------------------------------------------------------------------------+
|
Line 268... |
Line 271... |
268 |
$aso_zone_contenu = array();
|
271 |
// Recherche des informations provenant de l'application pour la complétion du squelette
|
269 |
|
272 |
|
270 |
// Contenu navigation
|
273 |
// Contenu navigation
|
Line 271... |
Line 274... |
271 |
// Appel de la fonction afficherContenuNavigation() si elle existe.
|
274 |
// Appel de la fonction afficherContenuNavigation() si elle existe.
|
272 |
$aso_zone_contenu['contenu_navigation'] = (function_exists('afficherContenuNavigation') ? afficherContenuNavigation() : '<!-- '.'Aucune navigation'.' -->');
|
275 |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = (function_exists('afficherContenuNavigation') ? afficherContenuNavigation() : '<!-- '.'Aucune navigation'.' -->');
|
273 |
|
276 |
|
274 |
// Contenu tête
|
277 |
// Contenu tête
|
275 |
// Appel de la fonction afficherContenuTete() si elle existe.
|
278 |
// Appel de la fonction afficherContenuTete() si elle existe.
|
276 |
$aso_zone_contenu['contenu_tete'] = (function_exists('afficherContenuTete') ? afficherContenuTete() : '<!-- '.'Aucun contenu tête'.' -->');
|
279 |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = (function_exists('afficherContenuTete') ? afficherContenuTete() : '<!-- '.'Aucun contenu tête'.' -->');
|
277 |
|
280 |
|
278 |
// Contenu corps
|
281 |
// Contenu corps
|
279 |
// Appel de la fonction afficherContenuCorps().
|
282 |
// Appel de la fonction afficherContenuCorps().
|
280 |
if (function_exists('afficherContenuCorps') ) {
|
283 |
if (function_exists('afficherContenuCorps') ) {
|
281 |
$aso_zone_contenu['contenu_corps'] = afficherContenuCorps();
|
284 |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = afficherContenuCorps();
|
282 |
} else {
|
285 |
} else {
|
283 |
$aso_zone_contenu['contenu_corps'] =
|
286 |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] =
|
Line 284... |
Line 287... |
284 |
'ERREUR Génésia : fonction afficherContenuCorps() introuvable dans l\'application demandée. <br />'.
|
287 |
'ERREUR Papyrus : fonction afficherContenuCorps() introuvable dans l\'application demandée. <br />'.
|
285 |
'Ligne n° : '. __LINE__ .'<br />'.
|
288 |
'Ligne n° : '. __LINE__ .'<br />'.
|
286 |
'Fichier : '. __FILE__;
|
289 |
'Fichier : '. __FILE__;
|
Line 287... |
Line 290... |
287 |
}
|
290 |
}
|
288 |
// Contenu pied
|
291 |
// Contenu pied
|
Line 289... |
Line 292... |
289 |
// Appel de la fonction afficherContenuPied() si elle existe.
|
292 |
// Appel de la fonction afficherContenuPied() si elle existe.
|
290 |
$aso_zone_contenu['contenu_pied'] = (function_exists('afficherContenuPied') ? afficherContenuPied() : '<!-- '.'Aucun contenu pied'.' -->');
|
293 |
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = (function_exists('afficherContenuPied') ? afficherContenuPied() : '<!-- '.'Aucun contenu pied'.' -->');
|
291 |
|
294 |
|
292 |
// +------------------------------------------------------------------------------------------------------+
|
295 |
// +------------------------------------------------------------------------------------------------------+
|
293 |
// Gestion de l'espace de nom pour les balise Papyrus
|
296 |
// Gestion de l'espace de nom pour les balise Papyrus
|
294 |
$_GEN_commun['balise_prefixe'] = 'PAPYRUS_';
|
297 |
$_GEN_commun['balise_prefixe'] = 'PAPYRUS_';
|
295 |
|
298 |
|
296 |
// +------------------------------------------------------------------------------------------------------+
|
299 |
// +------------------------------------------------------------------------------------------------------+
|
297 |
// Gestion des appels des fonctions d'applettes
|
300 |
// Gestion des appels des fonctions d'applettes
|
298 |
|
301 |
|
- |
|
302 |
for ($i = 0; $i < count($_GEN_commun['info_applette']); $i++) {
|
299 |
for ($i = 0; $i < count($_GEN_commun['info_applette']); $i++) {
|
303 |
// Recherche du nombre de balise d'une applette donnée présentes dans le squelette
|
- |
|
304 |
$GLOBALS['_PAPYRUS_']['applette']['nbr_balise'] = preg_match_all( '/<!-- '.$_GEN_commun['balise_prefixe'].'('.$_GEN_commun['info_applette'][$i]->applette_balise.') -->/',
|
- |
|
305 |
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'],
|
300 |
// Recherche du nombre de balise d'une applette donnée présentes dans le squelette
|
306 |
$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'],
|
- |
|
307 |
PREG_SET_ORDER);
|
301 |
$nbr_balise = preg_match_all( '/<!-- '.$_GEN_commun['balise_prefixe'].'('.$_GEN_commun['info_applette'][$i]->applette_balise.') -->/',
|
308 |
// Si on trouve au moins une balise, on lance la boucle pour les remplacer
|
302 |
$contenu_squelette,
|
309 |
for ($j = 0; $j <= ($GLOBALS['_PAPYRUS_']['applette']['nbr_balise'] - 1); $j++) {
|
303 |
$tab_applet_arguments,
|
310 |
// Nous vérifions que le nom de la fonction principale de l'applette existe.
|
304 |
PREG_SET_ORDER);
|
311 |
if (function_exists($_GEN_commun['info_applette'][$i]->applette_fonction)) {
|
305 |
// Si on trouve au moins une balise, on lance la boucle pour les remplacer
|
312 |
$GLOBALS['_PAPYRUS_']['applette']['contenu_applette'] =
|
306 |
for ($j = 0; $j <= ($nbr_balise - 1); $j++) {
|
313 |
call_user_func( $_GEN_commun['info_applette'][$i]->applette_fonction,
|
307 |
// Nous vérifions que le nom de la fonction principale de l'applette existe.
|
314 |
$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'][$j],
|
- |
|
315 |
$_GEN_commun);
|
308 |
if (function_exists($_GEN_commun['info_applette'][$i]->applette_fonction)) {
|
316 |
} else {
|
- |
|
317 |
$GLOBALS['_PAPYRUS_']['applette']['contenu_applette'] =
|
- |
|
318 |
'<!-- '."\n".
|
309 |
$contenu_applette = call_user_func($_GEN_commun['info_applette'][$i]->applette_fonction, $tab_applet_arguments[$j], $_GEN_commun);
|
319 |
$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'][$j][1].' : '.
|
310 |
} else {
|
320 |
'fonction de l\'applette "'.$_GEN_commun['info_applette'][$i]->gap_nom.'" introuvable! '."\n".
|
Line 311... |
Line 321... |
311 |
$contenu_applette = '<!-- '."\n".
|
321 |
'Fonction : '.$_GEN_commun['info_applette'][$i]->applette_fonction."\n".
|
312 |
$tab_applet_arguments[$j][1].' : '.
|
322 |
' -->';
|
Line 313... |
Line 323... |
313 |
'fonction de l\'applette "'.$_GEN_commun['info_applette'][$i]->gap_nom.'" introuvable! '."\n".
|
323 |
}
|
314 |
'Fonction : '.$_GEN_commun['info_applette'][$i]->applette_fonction."\n".
|
324 |
// Remplacement des balises d'applette de Génésia dans le squelette
|
315 |
' -->';
|
325 |
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'] =
|
316 |
}
|
326 |
str_replace( '<!-- '.$_GEN_commun['balise_prefixe'].$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'][$j][1].' -->',
|
317 |
// Remplacement des balises d'applette de Génésia dans le squelette
|
327 |
$GLOBALS['_PAPYRUS_']['applette']['contenu_applette'],
|
318 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].$tab_applet_arguments[$j][1].' -->', $contenu_applette, $contenu_squelette);
|
328 |
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette']);
|
319 |
}
|
329 |
}
|
320 |
}
|
330 |
}
|
321 |
|
331 |
|
Line 322... |
Line 332... |
322 |
// +------------------------------------------------------------------------------------------------------+
|
332 |
// +------------------------------------------------------------------------------------------------------+
|
323 |
// Continuation recherche d'info provenant de Papyrus pour la complétion du squelette
|
333 |
// Continuation recherche d'info provenant de Papyrus pour la complétion du squelette
|
324 |
|
- |
|
325 |
// Une fois l'application appelé est executé nous affichons le contenu de l'entête qui a pu
|
- |
|
326 |
// être modifié par l'application.
|
- |
|
327 |
$meta_http_equiv = GEN_afficherMeta('http-equiv');
|
- |
|
328 |
$meta_name = GEN_afficherMeta('name');
|
334 |
|
329 |
$meta_name_dc = GEN_afficherMeta('dc');
|
- |
|
330 |
// Nous récupérons tout les styles CSS pour l'afficher dans l'entête de la page.
|
335 |
// Une fois l'application appelé est executé nous affichons le contenu de l'entête qui a pu
|
331 |
$styles = GEN_afficherStyle();
|
336 |
// être modifié par l'application.
|
332 |
// Nous récupérons tout le Javascript pour l'afficher dans l'entête de la page.
|
337 |
$GLOBALS['_PAPYRUS_']['rendu']['META_HTTP_EQUIV'] = GEN_afficherMeta('http-equiv');
|
333 |
$scripts = GEN_afficherScript();
|
338 |
$GLOBALS['_PAPYRUS_']['rendu']['META_NAME'] = GEN_afficherMeta('name');
|
334 |
|
- |
|
335 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
336 |
// Remplacement des balises Papyrus dans le squelette
|
- |
|
337 |
|
- |
|
338 |
// Balise de l'entête (head) de la page xhtml
|
- |
|
339 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'TITRE_PAGE -->', $titre, $contenu_squelette);
|
- |
|
- |
|
339 |
$GLOBALS['_PAPYRUS_']['rendu']['META_NAME_DC'] = GEN_afficherMeta('dc');
|
Line 340... |
Line 340... |
340 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'META_HTTP_EQUIV -->', $meta_http_equiv, $contenu_squelette);
|
340 |
// Nous récupérons tout les styles CSS pour l'afficher dans l'entête de la page.
|
341 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'META_NAME -->', $meta_name, $contenu_squelette);
|
341 |
$GLOBALS['_PAPYRUS_']['rendu']['STYLES'] = GEN_afficherStyle();
|
342 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'META_NAME_DC -->', $meta_name_dc, $contenu_squelette);
|
342 |
// Nous récupérons tout le Javascript pour l'afficher dans l'entête de la page.
|
Line 343... |
Line 343... |
343 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'STYLES -->', $styles, $contenu_squelette);
|
343 |
$GLOBALS['_PAPYRUS_']['rendu']['SCRIPTS'] = GEN_afficherScript();
|
344 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'SCRIPTS -->', $scripts, $contenu_squelette);
|
344 |
|
345 |
// Balise du corps (body) de la page xhtml
|
345 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
346 |
// Remplacement des balises Papyrus dans le squelette
|
- |
|
347 |
foreach ($GLOBALS['_PAPYRUS_']['rendu'] as $GLOBALS['_PAPYRUS_']['tmp']['cle'] => $GLOBALS['_PAPYRUS_']['tmp']['val']) {
|
- |
|
348 |
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'] =
|
346 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'NOM_SITE -->', $nom_site, $contenu_squelette);
|
349 |
str_replace( '<!-- '.$_GEN_commun['balise_prefixe'].$GLOBALS['_PAPYRUS_']['tmp']['cle'].' -->',
|
347 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'SITE_LANGUE -->', $langue_site, $contenu_squelette);
|
350 |
$GLOBALS['_PAPYRUS_']['tmp']['val'],
|
348 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'SITE_CODE_ALPHA -->', $code_alpha_site, $contenu_squelette);
|
351 |
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette']);
|
349 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'CONTENU_NAVIGATION -->', $aso_zone_contenu['contenu_navigation'], $contenu_squelette);
|
352 |
}
|
350 |
$contenu_squelette = str_replace('<!-- '.$_GEN_commun['balise_prefixe'].'CONTENU_TETE -->', $aso_zone_contenu['contenu_tete'], $contenu_squelette);
|
353 |
|