Subversion Repositories eFlore/Projets.eflore-projets

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
163 jpm 1
<?php
2
class NomBasionymeDecorateur extends NomDecorateur {
3
 
4
	private $nomDecorateur = null;
5
	private $basionyme = null;
6
	private $basionymeId = null;
7
	private $detailsHrefTpl = null;
8
 
9
	public function __construct(NomDecorateur $nomDecorateur, $detailsHrefTpl) {
10
		$this->nomDecorateur = $nomDecorateur;
11
		$this->detailsHrefTpl = $detailsHrefTpl;
12
		if ($this->nomDecorateur->nom->verifierTag('basionyme')) {
13
			$this->basionymeId = $this->nomDecorateur->nom->getTag('basionyme');
14
		}
15
		if ($this->nomDecorateur->nom->verifierTag('nb_nom_sci')) {
16
			$this->basionyme = $this->nomDecorateur->nom->getTag('nb_nom_sci');
17
		}
18
	}
19
 
20
	public function ajouterId() {
21
		if (is_null($this->basionymeId) === false) {
22
			$this->nomDecorateur->nomFormate['basionyme.id'] = $this->basionymeId;
23
		}
24
	}
25
 
26
	public function ajouterHref() {
27
		if (is_null($this->basionymeId) === false) {
28
			$href = sprintf($this->detailsHrefTpl, $this->basionymeId);
29
			$this->nomDecorateur->nomFormate['basionyme.href'] = $href;
30
		}
31
	}
32
 
33
	public function ajouterIntitule() {
34
		if (is_null($this->basionyme) === false) {
35
			$this->nomDecorateur->nomFormate['basionyme'] = $this->basionyme;
36
		}
37
	}
38
}
39
?>