Rev 78 | Rev 110 | 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 4.1 |// +------------------------------------------------------------------------------------------------------+// | 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.3 2005-01-19 12:58:19 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 LEGNES <flegens@free.fr>//Autres auteurs :*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>*@copyright Tela-Botanica 2000-2004*@version $Revision: 1.3 $ $Date: 2005-01-19 12:58:19 $// +------------------------------------------------------------------------------------------------------+*/// +------------------------------------------------------------------------------------------------------+// | ENTETE du PROGRAMME |// +------------------------------------------------------------------------------------------------------+require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';// +------------------------------------------------------------------------------------------------------+// | 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>'.'Présent dans : '.'</h2>'."\n";$retour .= '<form id="eflore_form_projet" action="http://eflore-test.tela-botanica.org/serveurXML/eflore_serveur.php" method="get">'."\n";//{UrlProjetChangement}$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','afficherListeProjets');$retour .= '</select>'."\n";$retour .= '<input type="submit" value="ok" />'."\n";$retour .= '</p>'."\n";$retour .= '</form>'."\n";// Gestion du nom correct$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>PROJET_VERSION','afficherNomProjetVersion');$aso_param['statut_id'] = 3;$retour .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherNomCorrect', TRUE, $aso_param);// 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','afficherRechercheGoogle', TRUE, $aso_param);// Gestion de la synonymie$retour .= '<h2>'.'Synonymie : '.'</h2>'."\n";// Gestion des noms dont le statut n'est pas renseigné$aso_param['statut_id'] = 0;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherSynonyme', TRUE, $aso_param);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Statut non renseigné : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour .= $synonymie;}// Gestion des noms dont le statut est inconnu$aso_param['statut_id'] = 1;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherSynonyme', TRUE, $aso_param);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Statut inconnu : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour .= $synonymie;}// Gestion des noms dont le statut pose problème$aso_param['statut_id'] = 2;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherSynonyme', TRUE, $aso_param);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Statut posant problème : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour .= $synonymie;}// Gestion des synonymes taxonomiques$aso_param['statut_id'] = 4;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherSynonyme', TRUE, $aso_param);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes taxonomiques : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour .= $synonymie;}// Gestion des synonymes nomenclaturaux$aso_param['statut_id'] = 5;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherSynonyme', TRUE, $aso_param);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes nomenclaturaux : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour .= $synonymie;}// Gestion des synonymes indéterminés$aso_param['statut_id'] = 6;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherSynonyme', TRUE, $aso_param);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes indéterminés : '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour .= $synonymie;}// Gestion des synonymes "inclu dans"$aso_param['statut_id'] = 7;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherSynonyme', TRUE, $aso_param);if (!empty($retour_syno)) {$synonymie = '<h3>'.'Synonymes "inclu dans": '.'</h3>'."\n";$synonymie .= '<ol>'."\n";$synonymie .= $retour_syno;$synonymie .= '</ol>'."\n";$retour .= $synonymie;}// Gestion des synonymes au sens de$aso_param['statut_id'] = 8;$retour_syno = $this->leBlock->afficherPattern('FICHE_SYNTHESE>TAXON_NOMS','afficherSynonyme', TRUE, $aso_param);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 .= $synonymie;}// Gestion des noms vernaculaires$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 .= $this->leBlock->afficherPattern('FICHE_SYNTHESE>VERNACULAIRE_NOMS','afficherNomVernaculaire');$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 décodage de l'utf8echo 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="key" name="key" value="synthese" />'."\n";return $retour;}function afficherNomInfos($donnees){$retour = '';//$retour .= '<pre>'.print_r($donnees, true).'</pre>';//$retour .= '<br>';$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){$retour = '';$retour .= '<h2>'.'Nom correct dans le projet : '.$donnees['eprv_nom'].'</h2>'."\n";return $retour;}function afficherListeProjets($donnees){$retour = '';if ($donnees['nvp'] == $donnees['eprv_id_version']) {$retour .= ' <option value="'.$donnees['eprv_id_version'].'" checked="checked">'.$donnees['eprv_nom'].' - '.$donnees['epr_intitule_projet'].'</option>'."\n";} else {$retour .= ' <option value="'.$donnees['eprv_id_version'].'">'.$donnees['eprv_nom'].' - '.$donnees['epr_intitule_projet'].'</option>'."\n";}return $retour;}function afficherNomCorrect($donnees, $aso_param){$retour = '';//$retour .= '<pre>'.print_r($aso_param, true).'</pre>';if ($donnees['TAXON_NOMS']['esns_id_statut'] == $aso_param['statut_id']) {$retour .= '<p><strong>'.$donnees['TAXON_NOMS']['NOM_LATIN']['eni_intitule_nom'].'</strong></p>'."\n";}return $retour;}function afficherRechercheGoogle($donnees, $aso_param){$retour = '';//$retour .= '<pre>'.print_r($aso_param, 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['TAXON_NOMS']['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($aso_param, true).'</pre>';if ($donnees['TAXON_NOMS']['esns_id_statut'] == $aso_param['statut_id']) {$retour .= ' <li>'.$donnees['TAXON_NOMS']['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 $** +-- Fin du code ----------------------------------------------------------------------------------------+*/?>