Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 1279 → Rev 1280

/trunk/modules/fiche/Fiche.php
101,7 → 101,11
 
// titre de la fiche
$nom_html_fmt = $this->nom_retenu->get('nom_sci_html').' '.$this->nom_retenu->get('auteur');
$donnees['nom_retenu_html'] = $this->formaterLiensNomsHtml($nom_html_fmt);
// la recherche avancée à partir du clic sur le nom ne fonctionne pas sur les hybrides
$donnees['nom_retenu_html'] = strpos($nom_sci_html, 'class="hyb"') === false ?
$this->formaterLiensNomsHtml($nom_html_fmt) :
$nom_html_fmt;
$donnees['nom_retenu'] = $this->nom_retenu->get('nom_sci');
$donnees['nom_appele_html'] = $this->nom_appele_html;
$famille = $this->nom_retenu->getTaxonSupRang('180');
133,8 → 137,7
$this->ajouterPiedDePage();
}
private function formaterLiensNomsHtml($nom_sci_html) {
private function formaterLiensNomsHtml($nom_sci_html) {
$app_urls = new AppUrls();
$params = array();
$classes_recherche = array("fam" => "fam", "gen" => "gen", "sp" => "sp", "infra-sp" => "ssp");
142,12 → 145,13
$doc = new DOMDocument();
$doc->loadHTML($nom_sci_html);
$spans = $doc->getElementsByTagName('span');
$abbr = $doc->getElementsByTagName('abbr');
$abbrs = $doc->getElementsByTagName('abbr');
$params_subsp = array();
$i18n = I18n::get('Fiche');
//TODO: c'est un peu moche, la fonction est surement factorisable
if ($spans->length > 0) {
foreach($spans as $span) {
$classe = $span->getAttribute('class');
169,12 → 173,29
}
}
}
if ($abbrs->length > 0) {
foreach($abbrs as $abbr) {
$classe = $abbr->getAttribute('class');
$params_subsp["type"] = $abbr->nodeValue;
$lien_tpl = html_entity_decode($this->url->obtenirUrlRechercheAvancee($params_subsp));
$texte_lien = $abbr->nodeValue;
$abbr->nodeValue = "";
$text = $doc->createElement('a', $texte_lien);
$text->setAttribute('href', $lien_tpl);
$text->setAttribute('title', $i18n["lien-recherche-hier-ssp"]);
$text->setAttribute('class', 'lien_recherche_hier');
$abbr->appendChild($text);
}
}
// TODO: gérer le cas du type d'épithète infra-spécifique (qui est une abbréviation
// et donc la valeur ne correspond pas à ce qu'attend l'url de recherche)
return $doc->SaveXml();
}
private function formaterLienRechercheSurPartieNomSci(&$noeud, &$params) {
}
 
public function ajouterLienModuleExport() {
$donnees['lien'] = $this->url->obtenirUrlPdfExport($this->parametres['num_nom']);