32,7 → 32,7 |
// pris connaissance de la licence CeCILL, et que vous en avez accepté les |
// termes. |
// ---- |
// CVS : $Id: pap_rendu.inc.php,v 1.38 2007-04-19 15:34:35 neiluj Exp $ |
// CVS : $Id: pap_rendu.inc.php,v 1.39 2007-04-19 16:54:52 ddelon Exp $ |
/** |
* Rendu : programme traitant l'url demandée et retournant la page compressé au navigateur. |
* |
48,7 → 48,7 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.38 $ $Date: 2007-04-19 15:34:35 $ |
*@version $Revision: 1.39 $ $Date: 2007-04-19 16:54:52 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
119,21 → 119,92 |
} |
*/ |
// Lecture du fichier de squelette XHTML en PHP 4.3 |
|
|
|
|
// +------------------------------------------------------------------------------------------------------+ |
// Gestion des traductions |
|
// Si le r<E9>sultat de la n<E9>gociation de l'internationalisation donne une langue diff<E9>rente |
// de celle du site principal, nous r<E9>cup<E9>rons les <E9>ventuelles valeurs traduite pour le site. |
|
|
$id_langue = $GLOBALS['_GEN_commun']['i18n']; |
|
if (isset($id_langue) && ($id_langue!='')) { |
$langue_test=$id_langue; |
} else { |
$langue_test=GEN_I18N_ID_DEFAUT; |
} |
|
$requete = 'SELECT * '. |
'FROM gen_site '. |
'WHERE gs_ce_i18n = "'.$langue_test.'" '. |
// 'WHERE gs_ce_i18n = "'.$_GEN_commun['i18n'].'" '. |
'AND gs_code_num = "'.$GLOBALS['_GEN_commun']['info_site']->gs_code_num.'"'; |
$resultat = $db->query($requete); |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : ''; |
|
// Nous cr<E9><E9>ons l'entr<E9>e 'traduction_info_site' dans _GEN_commun que si nous avons bien trouv<E9> une |
// traduction pour le site. Il faut donc tester l'existence de cette entr<E9>e avant de l'utiliser. |
|
|
if ($resultat->numRows() > 0) { |
$GLOBALS['_GEN_commun']['traduction_info_site'] = $resultat->fetchRow(DB_FETCHMODE_OBJECT); |
} |
$resultat->free(); |
|
// Si le r<E9>sultat de la n<E9>gociation de l'internationalisation donne une langue diff<E9>rente |
// de celle du menu, nous r<E9>cup<E9>rons les <E9>ventuelles valeurs traduite pour le menu. |
|
// R<E9>cup<E9>ration des informations sur la traduction du menu |
$requete = 'SELECT * '. |
'FROM gen_menu '. |
'WHERE gm_ce_i18n = "'.$langue_test.'" '. |
// 'WHERE gm_ce_i18n = "'.$_GEN_commun['i18n'].'" '. |
'AND gm_code_num = "'.$GLOBALS['_GEN_commun']['info_menu']->gm_code_num.'"'; |
|
$resultat = $db->query($requete); |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : ''; |
|
// Nous cr<E9><E9>ons l'entr<E9>e 'traduction_info_menu' dans _GEN_commun que si nous avons bien trouv<E9> une |
// traduction pour le menu. Il faut donc tester l'existence de cette entr<E9>e avant de l'utiliser. |
if ($resultat->numRows() > 0) { |
$_GEN_commun['traduction_info_menu'] = $resultat->fetchRow(DB_FETCHMODE_OBJECT); |
} |
$resultat->free(); |
|
|
if (isset($GLOBALS['_GEN_commun']['traduction_info_site'])) { |
$type_site='traduction_info_site'; |
} |
else { |
$type_site='info_site'; |
} |
|
if (isset($GLOBALS['_GEN_commun']['traduction_info_menu'])) { |
$type_menu='traduction_info_menu'; |
} |
else { |
$type_menu='info_menu'; |
} |
|
|
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'] = file_get_contents($GLOBALS['_PAPYRUS_']['general']['chemin_squelette']); |
|
// +------------------------------------------------------------------------------------------------------+ |
// Recherche des informations pour la complétion de l'entête du squelette de la page demandée. |
|
if (isset($GLOBALS['_GEN_commun']['info_menu'])) { |
if (isset($GLOBALS['_GEN_commun'][$type_menu])) { |
// Construction du titre. |
if (! empty($GLOBALS['_GEN_commun']['info_menu']->gm_titre)) { |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun']['info_menu']->gm_titre); |
if (! empty($GLOBALS['_GEN_commun'][$type_menu]->gm_titre)) { |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_titre); |
} else if (! empty($GLOBALS['_GEN_commun']['info_menu']->gm_titre_alternatif)) { |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun']['info_menu']->gm_titre_alternatif); |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_titre_alternatif); |
} else { |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun']['info_menu']->gm_nom); |
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_nom); |
} |
|
} |
else { |
$GLOBALS['_PAPYRUS_']['page']['titre']=''; |
143,16 → 214,16 |
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $GLOBALS['_PAPYRUS_']['page']['titre']; |
|
// Construction des infos sur le site |
$GLOBALS['_PAPYRUS_']['page']['nom_site'] = htmlentities($GLOBALS['_GEN_commun']['info_site']->gs_nom); |
$GLOBALS['_PAPYRUS_']['page']['nom_site'] = htmlentities($GLOBALS['_GEN_commun'][$type_site]->gs_nom); |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_NOM'] = $GLOBALS['_PAPYRUS_']['page']['nom_site']; |
$GLOBALS['_PAPYRUS_']['page']['langue_site'] = htmlentities($GLOBALS['_GEN_commun']['i18n']); |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_LANGUE'] = $GLOBALS['_PAPYRUS_']['page']['langue_site']; |
$GLOBALS['_PAPYRUS_']['page']['code_alpha_site'] = htmlentities($GLOBALS['_GEN_commun']['info_site']->gs_code_alpha); |
$GLOBALS['_PAPYRUS_']['page']['code_alpha_site'] = htmlentities($GLOBALS['_GEN_commun'][$type_site]->gs_code_alpha); |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_CODE_ALPHA'] = $GLOBALS['_PAPYRUS_']['page']['code_alpha_site']; |
|
//Construction des infos sur le contexte d'affichage de la page |
$une_url = new Net_URL(); |
$une_url->addQueryString("site",$_GEN_commun['url_site']); |
$une_url->addQueryString("site",$GLOBALS['_GEN_commun']['url_site']); |
$une_url->removeQueryString("langue"); |
$GLOBALS['_PAPYRUS_']['rendu']['PAGE_URL'] = $une_url->getUrl(); |
|
161,7 → 232,7 |
$_GEN_commun['meta_http_equiv'] = array(); |
$GLOBALS['_PAPYRUS_']['page']['jeu_de_caracteres'] = htmlentities(strtoupper($_GEN_commun['info_i18n']->gi_jeu_de_caracteres)); |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_JEU_DE_CARACTERES'] = $GLOBALS['_PAPYRUS_']['page']['jeu_de_caracteres']; |
$GLOBALS['_PAPYRUS_']['page']['langue'] = htmlentities($_GEN_commun['info_i18n_langue']->gil_id_langue); |
$GLOBALS['_PAPYRUS_']['page']['langue'] = htmlentities($GLOBALS['_GEN_commun']['info_i18n_langue']->gil_id_langue); |
$GLOBALS['_PAPYRUS_']['rendu']['SITE_LANGUE'] = $GLOBALS['_PAPYRUS_']['page']['langue']; |
GEN_stockerMetaHttpEquiv('Content-Type', 'text/html; charset='.$GLOBALS['_PAPYRUS_']['page']['jeu_de_caracteres']); |
GEN_stockerMetaHttpEquiv('Content-style-type', 'text/css'); |
169,10 → 240,10 |
GEN_stockerMetaHttpEquiv('Content-language', $GLOBALS['_PAPYRUS_']['page']['langue']); |
|
// Construction des Meta "name". |
$_GEN_commun['meta_name'] = array(); |
if (isset($GLOBALS['_GEN_commun']['info_menu'])) { |
$GLOBALS['_PAPYRUS_']['page']['robot'] = htmlentities($_GEN_commun['info_menu']->gm_robot); |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($_GEN_commun['info_menu']->gm_auteur); |
$GLOBALS['_GEN_commun']['meta_name'] = array(); |
if (isset($GLOBALS['_GEN_commun'][$type_menu])) { |
$GLOBALS['_PAPYRUS_']['page']['robot'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_robot); |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_auteur); |
} |
else { |
$GLOBALS['_PAPYRUS_']['page']['robot'] = ''; |
180,19 → 251,19 |
} |
|
if (empty($GLOBALS['_PAPYRUS_']['page']['auteur'])) { |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($_GEN_commun['info_site']->gs_auteur); |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($GLOBALS['_GEN_commun'][$type_site]->gs_auteur); |
} |
if (isset($GLOBALS['_GEN_commun']['info_menu'])) { |
$GLOBALS['_PAPYRUS_']['page']['mots_cles'] = htmlentities($_GEN_commun['info_menu']->gm_mots_cles); |
$GLOBALS['_PAPYRUS_']['page']['mots_cles'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_mots_cles); |
} |
if (empty($GLOBALS['_PAPYRUS_']['page']['mots_cles'])) { |
$GLOBALS['_PAPYRUS_']['page']['mots_cles'] = htmlentities($_GEN_commun['info_site']->gs_mots_cles); |
$GLOBALS['_PAPYRUS_']['page']['mots_cles'] = htmlentities($GLOBALS['_GEN_commun'][$type_site]->gs_mots_cles); |
} |
if (isset($GLOBALS['_GEN_commun']['info_menu'])) { |
$GLOBALS['_PAPYRUS_']['page']['description_libre'] = htmlentities($_GEN_commun['info_menu']->gm_description_libre); |
$GLOBALS['_PAPYRUS_']['page']['description_libre'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_description_libre); |
} |
if (empty($GLOBALS['_PAPYRUS_']['page']['description_libre'])) { |
$GLOBALS['_PAPYRUS_']['page']['description_libre'] = htmlentities($_GEN_commun['info_site']->gs_description); |
$GLOBALS['_PAPYRUS_']['page']['description_libre'] = htmlentities($GLOBALS['_GEN_commun'][$type_site]->gs_description); |
} |
|
|
205,18 → 276,18 |
// Construction des Meta Meta "name" du Dublin Core. |
|
if (isset($GLOBALS['_GEN_commun']['info_menu'])) { |
$GLOBALS['_PAPYRUS_']['page']['titre_alternatif'] = htmlentities($_GEN_commun['info_menu']->gm_titre_alternatif); |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($_GEN_commun['info_menu']->gm_auteur); |
$GLOBALS['_PAPYRUS_']['page']['description_resume'] = htmlentities($_GEN_commun['info_menu']->gm_description_resume); |
$GLOBALS['_PAPYRUS_']['page']['description_table_matieres'] = htmlentities($_GEN_commun['info_menu']->gm_description_table_matieres); |
$GLOBALS['_PAPYRUS_']['page']['publieur'] = htmlentities($_GEN_commun['info_menu']->gm_editeur); |
$GLOBALS['_PAPYRUS_']['page']['contributeur'] = htmlentities($_GEN_commun['info_menu']->gm_contributeur); |
$GLOBALS['_PAPYRUS_']['page']['date_creation'] = htmlentities($_GEN_commun['info_menu']->gm_date_creation); |
$GLOBALS['_PAPYRUS_']['page']['date_soumission'] = htmlentities($_GEN_commun['info_menu']->gm_date_soumission); |
$GLOBALS['_PAPYRUS_']['page']['date_acceptation'] = htmlentities($_GEN_commun['info_menu']->gm_date_acceptation); |
$GLOBALS['_PAPYRUS_']['page']['periode_validite'] = htmlentities($_GEN_commun['info_menu']->gm_date_debut_validite); |
$GLOBALS['_PAPYRUS_']['page']['date_copyright'] = htmlentities($_GEN_commun['info_menu']->gm_date_copyright); |
$GLOBALS['_PAPYRUS_']['page']['source'] = htmlentities($_GEN_commun['info_menu']->gm_source); |
$GLOBALS['_PAPYRUS_']['page']['titre_alternatif'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_titre_alternatif); |
$GLOBALS['_PAPYRUS_']['page']['auteur'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_auteur); |
$GLOBALS['_PAPYRUS_']['page']['description_resume'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_description_resume); |
$GLOBALS['_PAPYRUS_']['page']['description_table_matieres'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_description_table_matieres); |
$GLOBALS['_PAPYRUS_']['page']['publieur'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_editeur); |
$GLOBALS['_PAPYRUS_']['page']['contributeur'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_contributeur); |
$GLOBALS['_PAPYRUS_']['page']['date_creation'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_date_creation); |
$GLOBALS['_PAPYRUS_']['page']['date_soumission'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_date_soumission); |
$GLOBALS['_PAPYRUS_']['page']['date_acceptation'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_date_acceptation); |
$GLOBALS['_PAPYRUS_']['page']['periode_validite'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_date_debut_validite); |
$GLOBALS['_PAPYRUS_']['page']['date_copyright'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_date_copyright); |
$GLOBALS['_PAPYRUS_']['page']['source'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_source); |
} |
else { |
$GLOBALS['_PAPYRUS_']['page']['titre_alternatif'] = ''; |
233,19 → 304,19 |
$GLOBALS['_PAPYRUS_']['page']['source'] = ''; |
} |
|
if ((isset($_GEN_commun['info_i18n_pays'])) && ($_GEN_commun['info_i18n_pays']->gip_id_pays != '')) { |
$GLOBALS['_PAPYRUS_']['page']['langue_rfc_3066'] = $GLOBALS['_PAPYRUS_']['page']['langue'].'-'.htmlentities($_GEN_commun['info_i18n_pays']->gip_id_pays); |
if ((isset($GLOBALS['_GEN_commun']['info_i18n_pays'])) && ($GLOBALS['_GEN_commun']['info_i18n_pays']->gip_id_pays != '')) { |
$GLOBALS['_PAPYRUS_']['page']['langue_rfc_3066'] = $GLOBALS['_PAPYRUS_']['page']['langue'].'-'.htmlentities($GLOBALS['_GEN_commun']['info_i18n_pays']->gip_id_pays); |
} else { |
$GLOBALS['_PAPYRUS_']['page']['langue_rfc_3066'] = $GLOBALS['_PAPYRUS_']['page']['langue']; |
} |
if (isset($GLOBALS['_GEN_commun']['info_menu'])) { |
$GLOBALS['_PAPYRUS_']['page']['type_portee_spatiale'] = htmlentities($_GEN_commun['info_menu']->gm_ce_type_portee_spatiale); |
$GLOBALS['_PAPYRUS_']['page']['portee_spatiale'] = htmlentities($_GEN_commun['info_menu']->gm_portee_spatiale); |
$GLOBALS['_PAPYRUS_']['page']['type_portee_temporelle'] = htmlentities($_GEN_commun['info_menu']->gm_ce_type_portee_temporelle); |
$GLOBALS['_PAPYRUS_']['page']['portee_temporelle'] = htmlentities($_GEN_commun['info_menu']->gm_portee_temporelle); |
$GLOBALS['_PAPYRUS_']['page']['licence'] = htmlentities($_GEN_commun['info_menu']->gm_licence); |
$GLOBALS['_PAPYRUS_']['page']['public'] = htmlentities($_GEN_commun['info_menu']->gm_public); |
$GLOBALS['_PAPYRUS_']['page']['public_niveau'] = htmlentities($_GEN_commun['info_menu']->gm_public_niveau); |
$GLOBALS['_PAPYRUS_']['page']['type_portee_spatiale'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_ce_type_portee_spatiale); |
$GLOBALS['_PAPYRUS_']['page']['portee_spatiale'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_portee_spatiale); |
$GLOBALS['_PAPYRUS_']['page']['type_portee_temporelle'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_ce_type_portee_temporelle); |
$GLOBALS['_PAPYRUS_']['page']['portee_temporelle'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_portee_temporelle); |
$GLOBALS['_PAPYRUS_']['page']['licence'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_licence); |
$GLOBALS['_PAPYRUS_']['page']['public'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_public); |
$GLOBALS['_PAPYRUS_']['page']['public_niveau'] = htmlentities($GLOBALS['_GEN_commun'][$type_menu]->gm_public_niveau); |
} |
else { |
$GLOBALS['_PAPYRUS_']['page']['type_portee_spatiale'] = ''; |
447,6 → 518,9 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.38 2007/04/19 15:34:35 neiluj |
* préparration release (livraison) "Narmer" - v0.25 |
* |
* Revision 1.37 2007/04/13 09:41:09 neiluj |
* réparration cvs |
* |