Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 843 | Details | Compare with Previous | 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;
207 jpm 8
	protected $correspondances = array(
9
		'basionyme' => 'Intitule',
10
		'basionyme.id' => 'Id',
11
		'basionyme.href' => 'Href',
12
		'basionyme.*' => 'Intitule,Id,Href');
163 jpm 13
 
14
	public function __construct(NomDecorateur $nomDecorateur, $detailsHrefTpl) {
15
		$this->nomDecorateur = $nomDecorateur;
16
		$this->detailsHrefTpl = $detailsHrefTpl;
17
		if ($this->nomDecorateur->nom->verifierTag('basionyme')) {
18
			$this->basionymeId = $this->nomDecorateur->nom->getTag('basionyme');
19
		}
20
		if ($this->nomDecorateur->nom->verifierTag('nb_nom_sci')) {
21
			$this->basionyme = $this->nomDecorateur->nom->getTag('nb_nom_sci');
22
		}
23
	}
24
 
25
	public function ajouterId() {
26
		if (is_null($this->basionymeId) === false) {
27
			$this->nomDecorateur->nomFormate['basionyme.id'] = $this->basionymeId;
28
		}
29
	}
30
 
31
	public function ajouterHref() {
32
		if (is_null($this->basionymeId) === false) {
33
			$href = sprintf($this->detailsHrefTpl, $this->basionymeId);
34
			$this->nomDecorateur->nomFormate['basionyme.href'] = $href;
35
		}
36
	}
37
 
38
	public function ajouterIntitule() {
39
		if (is_null($this->basionyme) === false) {
40
			$this->nomDecorateur->nomFormate['basionyme'] = $this->basionyme;
41
		}
42
	}
43
}
44
?>