Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 353 | Rev 661 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 353 Rev 485
Line 48... Line 48...
48
	private $cvarTpl = '<span class="cultivar">\'%s\'</span>';
48
	private $cvarTpl = '<span class="cultivar">\'%s\'</span>';
Line 49... Line 49...
49
 
49
 
50
	public function generer(Array $nomsDecomposes) {
50
	public function generer(Array $nomsDecomposes) {
51
		$nomsSciHtml = array();
51
		$nomsSciHtml = array();
-
 
52
		foreach ($nomsDecomposes as $infos) {
-
 
53
			$nom = $this->genererNomSciHtml($infos);
-
 
54
			if ($nom != '') {
-
 
55
				$nomsSciHtml[$this->num] = $nom;
-
 
56
			}
-
 
57
		}
-
 
58
		return $nomsSciHtml;
-
 
59
	}
-
 
60
 
52
		foreach ($nomsDecomposes as $infos) {
61
	public function genererNomSciHtml(Array $nomDecomposes) {
Line 53... Line 62...
53
			$this->initialiserVariables($infos);
62
		$this->initialiserVariables($nomDecomposes);
54
 
63
 
55
			$nomSciHtml = '';
64
		$nomSciHtml = '';
56
			$nomSciHtml .= $this->ajouterBaliseNomSupraGen();
65
		$nomSciHtml .= $this->ajouterBaliseNomSupraGen();
Line 60... Line 69...
60
			$nomSciHtml .= $this->ajouterBaliseTypeInfraSp();
69
		$nomSciHtml .= $this->ajouterBaliseTypeInfraSp();
61
			$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_infra_sp'], 'infra-sp');
70
		$nomSciHtml .= $this->verifierHybridite($this->compo_nom['epithete_infra_sp'], 'infra-sp');
62
			$nomSciHtml .= $this->ajouterCultivarGpComm();
71
		$nomSciHtml .= $this->ajouterCultivarGpComm();
Line 63... Line 72...
63
 
72
 
64
			if ($nomSciHtml != '') {
73
		if ($nomSciHtml != '') {
65
				$nomsSciHtml[$this->num] = sprintf($this->nomSciTpl, trim($nomSciHtml));
-
 
66
			}
74
			$nomSciHtml = sprintf($this->nomSciTpl, trim($nomSciHtml));
67
		}
75
		}
68
		return $nomsSciHtml;
76
		return $nomSciHtml;
Line 69... Line 77...
69
	}
77
	}
70
 
78
 
71
	private function initialiserVariables($infos) {
79
	private function initialiserVariables($infos) {
Line 88... Line 96...
88
	}
96
	}
Line 89... Line 97...
89
 
97
 
90
	private function ajouterBaliseInfraGen() {
98
	private function ajouterBaliseInfraGen() {
91
		$html = '';
99
		$html = '';
92
		if ($this->verifierTypeInfraGen()) {
100
		if ($this->verifierTypeInfraGen()) {
93
			$html .= $this->ajouterBaliseTypeInfraGen();
101
			$html = $this->ajouterBaliseTypeInfraGen();
94
		} else {
102
		} else {
95
			if ($this->avoirInfo('epithete_infra_generique')) {
103
			if ($this->avoirInfo('epithete_infra_generique')) {
96
				$html .= sprintf($this->infraGenTpl, $this->compo_nom['epithete_infra_generique']);
104
				$html = sprintf($this->infraGenTpl, $this->compo_nom['epithete_infra_generique']);
97
			}
105
			}
98
		}
106
		}
99
		return $html;
107
		return $html;
Line 112... Line 120...
112
		$html = '';
120
		$html = '';
113
		$type = $this->compo_nom['type_epithete'];
121
		$type = $this->compo_nom['type_epithete'];
Line 114... Line 122...
114
 
122
 
115
		if ($type == 'agg.') {
123
		if ($type == 'agg.') {
116
			// Ajout de l'infra gen avant le type s'il est égal à agg.
124
			// Ajout de l'infra gen avant le type s'il est égal à agg.
117
			$html .= ' '.$this->ajouterBaliseInfraGen().
125
			$html = ' '.$this->ajouterBaliseInfraGen().
118
					' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type);
126
					' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type);
119
		} else {
127
		} else {
120
			$html .= ' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type).
128
			$html = ' '.sprintf($this->typeEpitheteTpl, $this->abbr[$type], $type).
121
					' '.$this->ajouterBaliseInfraGen();
129
					' '.$this->ajouterBaliseInfraGen();
122
		}
130
		}
123
		return $html;
131
		return $html;