Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 484 → Rev 485

/trunk/scripts/bibliotheque/GenerateurNomSciHtml.php
50,24 → 50,32
public function generer(Array $nomsDecomposes) {
$nomsSciHtml = array();
foreach ($nomsDecomposes as $infos) {
$this->initialiserVariables($infos);
 
$nomSciHtml = '';
$nomSciHtml .= $this->ajouterBaliseNomSupraGen();
$nomSciHtml .= $this->verifierHybridite($this->compo_nom['genre'], 'gen');
$nomSciHtml .= $this->ajouterBaliseInfraGen();
$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_sp'], 'sp');
$nomSciHtml .= $this->ajouterBaliseTypeInfraSp();
$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_infra_sp'], 'infra-sp');
$nomSciHtml .= $this->ajouterCultivarGpComm();
 
if ($nomSciHtml != '') {
$nomsSciHtml[$this->num] = sprintf($this->nomSciTpl, trim($nomSciHtml));
$nom = $this->genererNomSciHtml($infos);
if ($nom != '') {
$nomsSciHtml[$this->num] = $nom;
}
}
return $nomsSciHtml;
}
 
public function genererNomSciHtml(Array $nomDecomposes) {
$this->initialiserVariables($nomDecomposes);
 
$nomSciHtml = '';
$nomSciHtml .= $this->ajouterBaliseNomSupraGen();
$nomSciHtml .= $this->verifierHybridite($this->compo_nom['genre'], 'gen');
$nomSciHtml .= $this->ajouterBaliseInfraGen();
$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_sp'], 'sp');
$nomSciHtml .= $this->ajouterBaliseTypeInfraSp();
$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_infra_sp'], 'infra-sp');
$nomSciHtml .= $this->ajouterCultivarGpComm();
 
if ($nomSciHtml != '') {
$nomSciHtml = sprintf($this->nomSciTpl, trim($nomSciHtml));
}
return $nomSciHtml;
}
 
private function initialiserVariables($infos) {
$this->num = $infos['num_nom'];
$this->compo_nom = $infos;
90,10 → 98,10
private function ajouterBaliseInfraGen() {
$html = '';
if ($this->verifierTypeInfraGen()) {
$html .= $this->ajouterBaliseTypeInfraGen();
$html = $this->ajouterBaliseTypeInfraGen();
} else {
if ($this->avoirInfo('epithete_infra_generique')) {
$html .= sprintf($this->infraGenTpl, $this->compo_nom['epithete_infra_generique']);
$html = sprintf($this->infraGenTpl, $this->compo_nom['epithete_infra_generique']);
}
}
return $html;
114,10 → 122,10
 
if ($type == 'agg.') {
// Ajout de l'infra gen avant le type s'il est égal à agg.
$html .= ' '.$this->ajouterBaliseInfraGen().
$html = ' '.$this->ajouterBaliseInfraGen().
' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type);
} else {
$html .= ' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type).
$html = ' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type).
' '.$this->ajouterBaliseInfraGen();
}
return $html;
/trunk/scripts/bibliotheque/Conteneur.php
55,6 → 55,13
return $this->partages['Messages'];
}
 
public function getGenerateurNomSciHtml() {
if (!isset($this->partages['GenerateurNomSciHtml'])){
$this->partages['GenerateurNomSciHtml'] = new GenerateurNomSciHtml();
}
return $this->partages['GenerateurNomSciHtml'];
}
 
public function getRestClient() {
if (!isset($this->partages['RestClient'])){
$this->partages['RestClient'] = new RestClient();