Rev 124 | Rev 180 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php/*vim: set expandtab tabstop=4 shiftwidth=4: */// +------------------------------------------------------------------------------------------------------+// | PHP version 5.0.3 |// +------------------------------------------------------------------------------------------------------+// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |// +------------------------------------------------------------------------------------------------------+// | This file is part of eRibo. |// | |// | Foobar is free software; you can redistribute it and/or modify |// | it under the terms of the GNU General Public License as published by |// | the Free Software Foundation; either version 2 of the License, or |// | (at your option) any later version. |// | |// | Foobar is distributed in the hope that it will be useful, |// | but WITHOUT ANY WARRANTY; without even the implied warranty of |// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |// | GNU General Public License for more details. |// | |// | You should have received a copy of the GNU General Public License |// | along with Foobar; if not, write to the Free Software |// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |// +------------------------------------------------------------------------------------------------------+// CVS : $Id: fiche_synthese_xhtml.php,v 1.8 2005-02-14 18:11:43 jpm Exp $/*** Vue affichant la fiche de synthèse d'un nom dans le projet donné** Permet de retourner le html correspondant à la fiche de synthèse d'un nom* dans un projet donné.**@package eFlore*@subpackage Vues//Auteur original :*@author Frédéric LEGENS <flegens@free.fr>//Autres auteurs :*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>*@copyright Tela-Botanica 2000-2004*@version $Revision: 1.8 $ $Date: 2005-02-14 18:11:43 $// +------------------------------------------------------------------------------------------------------+*/// +------------------------------------------------------------------------------------------------------+// | ENTETE du PROGRAMME |// +------------------------------------------------------------------------------------------------------+require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';$GLOBALS['nbre_projet'] = 0;// +------------------------------------------------------------------------------------------------------+// | CLASSE de la VUE |// +------------------------------------------------------------------------------------------------------+class fiche_synthese_xhtml implements iVue {protected $leBlock;function __construct($unBlock){$this->leBlock = $unBlock;}function serialiser(){// La page xhtml :$retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";$retour .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";$retour .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" >'."\n";$retour .= '<head>'."\n";$retour .= '<!-- BEGIN entete -->'."\n";$retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";$retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";$retour .= '<meta http-equiv="Content-script-type" content="text/javascript" />'."\n";$retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";$retour .= '<title>Synthèse d\'un nom latin</title>'."\n";$retour .= '<!-- END entete -->'."\n";$retour .= '</head>'."\n";$retour .= '<body>'."\n";$retour .= '<!-- BEGIN corps -->'."\n";$retour .= '<h1>'.'Synthèse d\'un nom latin'.'</h1>'."\n";$retour .= '<h2>'.'Informations sur le nom :'.'</h2>'."\n";$retour .= '<p>'."\n";$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>NOM_LATIN','afficherNomInfos');$retour .= '</p>'."\n";$retour .= '<h2>'.'Projet courant: '.'</h2>';$retour .= '<p>'."\n";$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>PROJET_VERSION','afficherNomProjetVersion');$retour .= '</p>'."\n";$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>NOM_SELECTION_PROJETS','compterProjets');if ($GLOBALS['nbre_projet'] == 1) {$retour .= '<h2>'.'Présent uniquement dans le projet : '.'</h2>'."\n";$retour .= '<p>'."\n";$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>PROJET_VERSION','afficherNomProjetVersion');$retour .= '</p>'."\n";} else if ($GLOBALS['nbre_projet'] > 1 AND $GLOBALS['nbre_projet'] < 6) {$retour .= '<h2>'.'Présent dans les projets: '.'</h2>'."\n";$retour .= '<ul>'."\n";$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>NOM_SELECTION_PROJETS','afficherListeProjets', null, TRUE);$retour .= '</ul>'."\n";} else {$retour .= '<h2>'.'Présent dans les projets: '.'</h2>'."\n";$retour .= '<form id="eflore_form_projet" action="{FormUrlProjetChangement}" method="post">'."\n";$retour .= '<p>'."\n";$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>NOM_LATIN','afficherChampNom');$retour .= '<select id="nvp" name="nvp">'."\n";$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>NOM_SELECTION_PROJETS','afficherOptionProjets', null, TRUE);$retour .= '</select>'."\n";$retour .= '<input type="submit" value="ok" />'."\n";$retour .= '</p>'."\n";$retour .= '</form>'."\n";}// Gestion du nom correct$retour .= '<h2>'.'Nom correct dans le projet courant: ';$retour .= '</h2>'."\n";$aso_param['statut_id'] = 3;$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherNomCorrect', $aso_param, TRUE);// Gestion de la recherche Google$retour .= '<h2>'.'Rechercher des illustrations avec Google : '.'</h2>'."\n";$aso_param['statut_id'] = 3;$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherRechercheGoogle', $aso_param, TRUE);// Gestion de la synonymie// Gestion des noms dont le statut n'est pas renseigné$aso_param['statut_id'] = 0;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherSynonyme', $aso_param, TRUE);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Statut non renseigné : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour_syno_final .= $synonymie;}// Gestion des noms dont le statut est inconnu$aso_param['statut_id'] = 1;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherSynonyme', $aso_param, TRUE);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Statut inconnu : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour_syno_final .= $synonymie;}// Gestion des noms dont le statut pose problème$aso_param['statut_id'] = 2;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherSynonyme', $aso_param, TRUE);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Statut posant problème : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour_syno_final .= $synonymie;}// Gestion des synonymes taxonomiques$aso_param['statut_id'] = 4;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherSynonyme', $aso_param, TRUE);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes taxonomiques : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour_syno_final .= $synonymie;}// Gestion des synonymes nomenclaturaux$aso_param['statut_id'] = 5;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherSynonyme', $aso_param, TRUE);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes nomenclaturaux : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour_syno_final .= $synonymie;}// Gestion des synonymes indéterminés$aso_param['statut_id'] = 6;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherSynonyme', $aso_param, TRUE);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes indéterminés : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour_syno_final .= $synonymie;}// Gestion des synonymes "inclu dans"$aso_param['statut_id'] = 7;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherSynonyme', $aso_param, TRUE);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes "inclu dans": '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour_syno_final .= $synonymie;}// Gestion des synonymes au sens de$aso_param['statut_id'] = 8;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS>NOM_LATIN','afficherSynonyme', $aso_param, TRUE);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes "au sens de (<i>sensu</i>)": '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour_syno_final .= $synonymie;}if (empty($retour_syno_final)) {$retour .= '<h2>'.'Synonymie : '.'</h2>'."\n";$retour .= '<p>'.'Aucune synonymie pour ce nom dans ce projet.'.'</p>'."\n";} else {$retour .= '<h2>'.'Synonymie : '.'</h2>'."\n";$retour .= $retour_syno_final;}// Gestion des noms vernaculaires$nom_verna_lignes = $this->leBlock->afficherPattern('FICHE_SYNTHESE>VERNACULAIRE_NOMS','afficherNomVernaculaire');if (empty($nom_verna_lignes)) {$retour .= '<h2>'.'Noms vernaculaires :'.'</h2>'."\n";$retour .= '<p>'.'Aucun nom vernaculaire pour ce taxon dans ce projet.'.'</p>'."\n";} else {$retour .= '<h2>'.'Noms vernaculaires : '.'</h2>'."\n";$retour .= '<table id="tableau_nom_verna">'."\n";$retour .= ' <thead>'."\n";$retour .= ' <tr><th>'.'Langue'.'</th><th>'.'Pays'.'</th><th>'.'Nom'.'</th><th>'.'Emploi'.'</th><th>'.'Genre et nombre'.'</th></tr>'."\n";$retour .= ' </thead>'."\n";$retour .= ' <tbody>'."\n";$retour .= $nom_verna_lignes;$retour .= ' </tbody>'."\n";$retour .= '</table>'."\n";}$retour .= '<!-- END corps -->'."\n";$retour .= '<!-- BEGIN pied -->'."\n";$retour .= '<p>'.'Si vous constatez des erreurs ou des insuffisances en consultant cet index, veuillez contacter '."\n";$retour .= ' <a href="mailto:eflore_remarques@tela-botanica.org">l\'équipe d\'eFlore</a>.'."\n";$retour .= '</p>'."\n";$retour .= '<p>'."\n";$retour .= ' <a href="http://jigsaw.w3.org/css-validator/check/referer">'."\n";$retour .= ' <img class="reference" src="/accueil/images/references/css.png" alt="CSS valide!" />'."\n";$retour .= ' </a>'."\n";$retour .= ' <a href="http://validator.w3.org/check?uri=referer">'."\n";$retour .= ' <img class="reference" src="/accueil/images/references/xhtml11.png" alt="XHTML 1.1 valide!" />'."\n";$retour .= ' </a>'."\n";$retour .= ' <a href="http://frenchmozilla.org">'."\n";$retour .= ' <img class="reference" src="/accueil/images/references/firefox.png" alt="Télécharger un très bon navigateur!" />'."\n";$retour .= ' </a>'."\n";$retour .= '</p>'."\n";$retour .= '<!-- END pied -->'."\n";$retour .= '</body>'."\n";$retour .= '</html>'."\n";// Envoi au navigateur après encodage en entité des caractères posant problèmeecho remplaceEntiteHTLM($retour);}}// +------------------------------------------------------------------------------------------------------+// | LISTE des FONCTIONS |// +------------------------------------------------------------------------------------------------------+function construireNomLatin($donnees, $bool_nom_court = FALSE){// Constitution du nom:$nom = '';if (!empty($donnees['en_nom_supra_generique'])) {$nom .= $donnees['en_nom_supra_generique'];} else if (!empty($donnees['en_epithete_infra_generique'])){$nom .= $donnees['en_epithete_infra_generique'];} else {if (!empty($donnees['en_nom_genre'])) {$nom .= $donnees['en_nom_genre'];}if (!empty($donnees['en_epithete_espece'])) {$nom .= ' '.$donnees['en_epithete_espece'];}if (!empty($donnees['en_epithete_infra_specifique'])) {if (!empty($donnees['enrg_abreviation_rang'])) {$nom .= ' '.$donnees['enrg_abreviation_rang'].'';}$nom .= ' '.$donnees['en_epithete_infra_specifique'];}}if (!$bool_nom_court) {$auteur_basio = '';$auteur_modif = '';if (!empty($donnees['intitule_abrege_auteur_basio_ex']) && $donnees['en_ce_auteur_basio_ex'] != 0) {$auteur_basio .= $donnees['intitule_abrege_auteur_basio_ex'];if (!empty($donnees['intitule_abrege_auteur_basio'])) {$auteur_basio .= ' ex '.$donnees['intitule_abrege_auteur_basio'];}} else if (!empty($donnees['intitule_abrege_auteur_basio']) && $donnees['en_ce_auteur_basio'] != 0) {$auteur_basio .= $donnees['intitule_abrege_auteur_basio'];}if (!empty($donnees['intitule_abrege_auteur_modif_ex']) && $donnees['en_ce_auteur_modif_ex'] != 0) {$auteur_modif .= $donnees['intitule_abrege_auteur_modif_ex'];if (!empty($donnees['intitule_abrege_auteur_modif'])) {$auteur_modif .= ' ex '.$donnees['intitule_abrege_auteur_modif'];}} else if (!empty($donnees['intitule_abrege_auteur_modif']) && $donnees['en_ce_auteur_modif'] != 0) {$auteur_modif .= $donnees['intitule_abrege_auteur_modif'];}if (!empty($auteur_modif)) {$nom .= ' ('.$auteur_basio.') ex '.$auteur_modif;} else {$nom .= ' '.$auteur_basio;}}return $nom;}function afficherChampNom($donnees){$retour = '';$retour .= '<input type="hidden" id="nn" name="nn" value="'.$donnees['en_id_nom'].'" />'."\n";$retour .= '<input type="hidden" id="cle" name="cle" value="synthese" />'."\n";return $retour;}function afficherNomInfos($donnees){$retour = '';//$retour .= '<pre>'.print_r($donnees, true).'</pre>';$retour .= 'Numéro nomenclatural absolu : '.$donnees['en_id_nom']."\n";$retour .= '<br />';$retour .= 'Nom sélectionné précédemment : '.construireNomLatin($donnees).'<br />'."\n";return $retour;}function afficherNomProjetVersion($donnees){return $donnees['eprv_nom'];}function compterProjets($donnees){$GLOBALS['nbre_projet']++;}function afficherListeProjets($donnees){$retour = '';if ($donnees['FICHE_SYNTHESE']['nvp'] != $donnees['NOM_SELECTION_PROJETS']['eprv_id_version']) {$retour .= ' <li>';$retour .= '<a href="{LienUrlProjetChangement}'.$donnees['NOM_SELECTION_PROJETS']['eprv_id_version'].'" title="Consulter la fiche de ce projet.">';$retour .= $donnees['NOM_SELECTION_PROJETS']['eprv_nom'].' - '.$donnees['NOM_SELECTION_PROJETS']['epr_intitule_projet'];$retour .= '</a>';$retour .= '</li>'."\n";}return $retour;}function afficherOptionProjets($donnees){$retour = '';if ($donnees['FICHE_SYNTHESE']['nvp'] != $donnees['NOM_SELECTION_PROJETS']['eprv_id_version']) {$retour .= ' <option value="'.$donnees['NOM_SELECTION_PROJETS']['eprv_id_version'].'">';$retour .= $donnees['NOM_SELECTION_PROJETS']['eprv_nom'].' - '.$donnees['NOM_SELECTION_PROJETS']['epr_intitule_projet'];$retour .= '</option>'."\n";}return $retour;}function afficherNomCorrect($donnees, $aso_param){$retour = '';//$retour .= '<pre>'.print_r($donnees, true).'</pre>';if ($donnees['TAXON_NOMS']['esns_id_statut'] == $aso_param['statut_id']) {$retour .= '<p><strong>'.$donnees['NOM_LATIN']['eni_intitule_nom'].'</strong></p>'."\n";}return $retour;}function afficherRechercheGoogle($donnees, $aso_param){$retour = '';//$retour .= '<pre>'.print_r($donnees, true).'</pre>';if ($donnees['TAXON_NOMS']['esns_id_statut'] == $aso_param['statut_id']) {$retour .= '<form method="get" action="http://images.google.fr/images">'."\n";$retour .= '<p>'."\n";$retour .= '<a href="http://www.google.com/" title="Aller sur Google France">'."\n";$retour .= ' <img src="http://www.google.com/logos/Logo_25wht.gif" alt="Google" />'."\n";$retour .= '</a>'."\n";$retour .= '<input type="text" name="q" size="25" maxlength="255" value="'.construireNomLatin($donnees['NOM_LATIN'], TRUE).'" />'."\n";$retour .= '<input type="hidden" name="ie" value="ISO-8859-1" />'."\n";$retour .= '<input type="hidden" name="oe" value="ISO-8859-1" />'."\n";$retour .= '<input type="hidden" name="hl" value="fr" />'."\n";$retour .= '<input type="submit" name="btnG" value="Recherche Google" />'."\n";$retour .= '</p>'."\n";$retour .= '</form>'."\n";}return $retour;}function afficherSynonyme($donnees, $aso_param){$retour = '';//$retour .= '<pre>'.print_r($donnees, true).'</pre>';if ($donnees['TAXON_NOMS']['esns_id_statut'] == $aso_param['statut_id']) {$retour .= ' <li>'.$donnees['NOM_LATIN']['eni_intitule_nom'].'</li>'."\n";}return $retour;}function afficherNomVernaculaire($donnees){$retour = '';$retour .= ' <tr>';$retour .= '<td title="'.$donnees['el_nom_langue_principal'].'">'.$donnees['el_code_langue'].'</td>';$retour .= '<td title="'.$donnees['ezg_intitule_principal_zg'].'">'.$donnees['ezg_code_zg'].'</td>';if ($donnees['evce_id_emploi'] == 0) {// Non renseigné$retour .= '<td>'.$donnees['ev_intitule_nom_vernaculaire'].'</td>';$retour .= '<td> </td>';} else if ($donnees['evce_id_emploi'] == 3) {// Recommandé ou typique$retour .= '<td><strong>'.$donnees['ev_intitule_nom_vernaculaire'].'</strong></td>';$retour .= '<td><strong>'.$donnees['evce_intitule_conseil_emlploi'].'</strong></td>';} else if ($donnees['evce_id_emploi'] == 2) {// Secondaire ou régional$retour .= '<td><emphasis>'.$donnees['ev_intitule_nom_vernaculaire'].'</emphasis></td>';$retour .= '<td><emphasis>'.$donnees['evce_intitule_conseil_emlploi'].'</emphasis></td>';} else {$retour .= '<td>'.$donnees['ev_intitule_nom_vernaculaire'].'</td>';$retour .= '<td>'.$donnees['evce_intitule_conseil_emlploi'].'</td>';}if ($donnees['egn_id_genre_nombre'] == 0) {$retour .= '<td> </td>';} else {$retour .= '<td>'.$donnees['egn_intitule'].'</td>';}$retour .= '</tr>'."\n";return $retour;}// +------------------------------------------------------------------------------------------------------+// | PIED du PROGRAMME |// +------------------------------------------------------------------------------------------------------+/* +--Fin du code ----------------------------------------------------------------------------------------+** $Log: not supported by cvs2svn $* Revision 1.7 2005/01/28 19:46:18 jpm* Amélioration de l'affichage des projets utilisant le noms sélectionné.** Revision 1.6 2005/01/26 10:44:57 jpm* Correction de la version de PHP.** Revision 1.5 2005/01/25 12:26:19 jpm* Utilisation de mot clé pour le template à la place des urls.** Revision 1.4 2005/01/24 16:53:25 jpm* Modification des méthodes permettant la récupération des données de la hiérarchie.** Revision 1.3 2005/01/19 12:58:19 jpm* Début des tests pour gérer le formulaire de changement de projet.*** +-- Fin du code ----------------------------------------------------------------------------------------+*/?>