Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1277 | Rev 1282 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1277 Rev 1280
Line 99... Line 99...
99
		$this->setSortie('tags', $this->nom_retenu->get('nom_sci').",".$verna.
99
		$this->setSortie('tags', $this->nom_retenu->get('nom_sci').",".$verna.
100
			",botanique,plante,description,ecologie,reconnaitre,fiche espece");
100
			",botanique,plante,description,ecologie,reconnaitre,fiche espece");
Line 101... Line 101...
101
 
101
 
102
		// titre de la fiche
102
		// titre de la fiche
-
 
103
		$nom_html_fmt = $this->nom_retenu->get('nom_sci_html').' '.$this->nom_retenu->get('auteur');
-
 
104
		
-
 
105
		// la recherche avancée à partir du clic sur le nom ne fonctionne pas sur les hybrides
103
		$nom_html_fmt = $this->nom_retenu->get('nom_sci_html').' '.$this->nom_retenu->get('auteur');
106
		$donnees['nom_retenu_html'] = strpos($nom_sci_html, 'class="hyb"') === false ? 
-
 
107
											$this->formaterLiensNomsHtml($nom_html_fmt) :
104
		$donnees['nom_retenu_html'] = $this->formaterLiensNomsHtml($nom_html_fmt);
108
											$nom_html_fmt;
105
		$donnees['nom_retenu'] = $this->nom_retenu->get('nom_sci');
109
		$donnees['nom_retenu'] = $this->nom_retenu->get('nom_sci');
106
		$donnees['nom_appele_html'] = $this->nom_appele_html;
110
		$donnees['nom_appele_html'] = $this->nom_appele_html;
107
		$famille = $this->nom_retenu->getTaxonSupRang('180');
111
		$famille = $this->nom_retenu->getTaxonSupRang('180');
108
		$donnees['lien_recherche_famille'] = html_entity_decode($this->url->obtenirUrlRechercheAvancee(array("fam" => $famille)));
112
		$donnees['lien_recherche_famille'] = html_entity_decode($this->url->obtenirUrlRechercheAvancee(array("fam" => $famille)));
Line 131... Line 135...
131
		
135
		
132
		$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil_niveau'.$niveau, $donnees), true);
136
		$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil_niveau'.$niveau, $donnees), true);
133
		$this->ajouterPiedDePage();
137
		$this->ajouterPiedDePage();
Line 134... Line 138...
134
	}
138
	}
135
	
-
 
136
	private function formaterLiensNomsHtml($nom_sci_html) {
139
	
137
		
140
	private function formaterLiensNomsHtml($nom_sci_html) {		
138
		$app_urls = new AppUrls();
141
		$app_urls = new AppUrls();
Line 139... Line 142...
139
		$params = array();
142
		$params = array();
140
		$classes_recherche = array("fam" => "fam", "gen" => "gen", "sp" => "sp", "infra-sp" => "ssp");
143
		$classes_recherche = array("fam" => "fam", "gen" => "gen", "sp" => "sp", "infra-sp" => "ssp");
141
		
144
		
142
		$doc = new DOMDocument();
145
		$doc = new DOMDocument();
Line 143... Line 146...
143
		$doc->loadHTML($nom_sci_html);
146
		$doc->loadHTML($nom_sci_html);
Line 144... Line 147...
144
		$spans = $doc->getElementsByTagName('span');
147
		$spans = $doc->getElementsByTagName('span');
145
		$abbr = $doc->getElementsByTagName('abbr');
148
		$abbrs = $doc->getElementsByTagName('abbr');
-
 
149
		
146
		
150
		$params_subsp = array();
147
		$params_subsp = array();
151
		
148
		
152
		$i18n =  I18n::get('Fiche');
149
		$i18n =  I18n::get('Fiche');
153
		
Line 167... Line 171...
167
					$text->setAttribute('class', 'lien_recherche_hier');
171
					$text->setAttribute('class', 'lien_recherche_hier');
168
					$span->appendChild($text);
172
					$span->appendChild($text);
169
				}
173
				}
170
			}
174
			}
171
		}
175
		}
172
		
176
			
-
 
177
		if ($abbrs->length > 0) {
-
 
178
			foreach($abbrs as $abbr) {
-
 
179
				$classe = $abbr->getAttribute('class');
-
 
180
				$params_subsp["type"] = $abbr->nodeValue;
173
		// TODO: gérer le cas du type d'épithète infra-spécifique (qui est une abbréviation
181
				$lien_tpl = html_entity_decode($this->url->obtenirUrlRechercheAvancee($params_subsp));
-
 
182
				$texte_lien = $abbr->nodeValue;
-
 
183
					
-
 
184
				$abbr->nodeValue = "";
-
 
185
				$text = $doc->createElement('a', $texte_lien);
-
 
186
				$text->setAttribute('href', $lien_tpl);
-
 
187
				$text->setAttribute('title', $i18n["lien-recherche-hier-ssp"]);
174
		// et donc la valeur ne correspond pas à ce qu'attend l'url de recherche)
188
				$text->setAttribute('class', 'lien_recherche_hier');
-
 
189
				$abbr->appendChild($text);
-
 
190
			}
-
 
191
		}
Line 175... Line 192...
175
		
192
		
176
		return $doc->SaveXml();
193
		return $doc->SaveXml();
-
 
194
	}
-
 
195
	
-
 
196
	private function formaterLienRechercheSurPartieNomSci(&$noeud, &$params) {
-
 
197
		
Line 177... Line 198...
177
	}
198
	}
178
 
199
 
179
	public function ajouterLienModuleExport() {
200
	public function ajouterLienModuleExport() {
180
		$donnees['lien'] = $this->url->obtenirUrlPdfExport($this->parametres['num_nom']);
201
		$donnees['lien'] = $this->url->obtenirUrlPdfExport($this->parametres['num_nom']);