Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 204 Rev 207
Line 1... Line 1...
1
<?php
1
<?php
2
class NomFormateur {
2
class NomFormateur {
Line 3... Line 3...
3
 
3
 
-
 
4
	private $nomAFormater = null;
-
 
5
	private $decorateurs = array();
-
 
6
	private $bdd = null;
-
 
7
	private $champsProjet = array();
-
 
8
	private $champsRetour = null;
-
 
9
	private $detailsHrefTpl = null;
Line 4... Line 10...
4
	private $nomAFormater = null;
10
	private $ontologieHrefTpl = null;
5
 
11
 
6
	public function __construct(NomDO $nomDO) {
12
	public function __construct(NomDO $nomDO) {
Line 7... Line 13...
7
		$this->nomAFormater = $nomDO;
13
		$this->nomAFormater = $nomDO;
8
	}
14
	}
9
 
15
 
10
	public function formater() {
-
 
Line 11... Line 16...
11
		$nomDeco = new NomDecorateur($this->nomAFormater);
16
	public function setChampsRetour(Array $champsRetour) {
12
		$nomDeco->ajouterId();
17
		$this->champsRetour = $champsRetour;
13
		$nomDeco->ajouterIntitule();
18
	}
14
 
-
 
15
		$retenuDeco = new NomRetenuDecorateur($nomDeco, $this->detailsHrefTpl);
-
 
Line 16... Line -...
16
		$retenuDeco->ajouterRetenu();
-
 
17
		$retenuDeco->ajouterId();
-
 
18
		$retenuDeco->ajouterIntitule();
19
 
19
		$retenuDeco->ajouterHref();
20
	public function setChampsProjet(Array $champsProjet) {
-
 
21
		$this->champsProjet = $champsProjet;
Line 20... Line 22...
20
 
22
	}
21
		$rangDeco = new NomRangDecorateur($nomDeco, $this->bdd, $this->ontologieHrefTpl);
23
 
-
 
24
	public function setDetailsHrefTpl($tpl) {
Line 22... Line -...
22
		$rangDeco->ajouterCode();
-
 
23
		$rangDeco->ajouterIntitule();
-
 
24
		$rangDeco->ajouterHref();
25
		$this->detailsHrefTpl = $tpl;
25
 
26
	}
26
		$compoDeco = new NomCompoDecorateur($nomDeco);
27
 
Line -... Line 28...
-
 
28
	public function setBdd($bdd) {
-
 
29
		$this->bdd = $bdd;
-
 
30
	}
-
 
31
 
-
 
32
	public function setOntologieHrefTpl($tpl) {
27
		$compoDeco->ajouterCompo();
33
		$this->ontologieHrefTpl = $tpl;
28
 
-
 
29
		$nomDeco->ajouterAuteur();
-
 
30
		$nomDeco->ajouterAnnee();
-
 
31
		$nomDeco->ajouterBiblio();
-
 
32
		$nomDeco->ajouterAddendum();
34
	}
33
		$nomDeco->ajouterNotes();
-
 
Line -... Line 35...
-
 
35
 
-
 
36
	public function formaterDetails() {
-
 
37
		$nomDeco = new NomDecorateur($this->nomAFormater, $this->detailsHrefTpl);
-
 
38
		$retenuDeco = new NomRetenuDecorateur($nomDeco, $this->detailsHrefTpl);
-
 
39
		$rangDeco = new NomRangDecorateur($nomDeco, $this->bdd, $this->ontologieHrefTpl);
-
 
40
		$compoDeco = new NomCompoDecorateur($nomDeco);
-
 
41
		$basioDeco = new NomBasionymeDecorateur($nomDeco, $this->detailsHrefTpl);
-
 
42
		$projetDeco = new NomChampsProjetDecorateur($nomDeco, $this->champsProjet);
-
 
43
 
-
 
44
		if ($this->avoirDemandeChampsRetour()) {
-
 
45
			$this->decorateurs[] = $nomDeco;
-
 
46
			$this->decorateurs[] = $retenuDeco;
-
 
47
			$this->decorateurs[] = $rangDeco;
-
 
48
			$this->decorateurs[] = $compoDeco;
-
 
49
			$this->decorateurs[] = $basioDeco;
-
 
50
			$this->decorateurs[] = $projetDeco;
-
 
51
 
-
 
52
			$this->traiterChampsRetour();
-
 
53
		} else {
-
 
54
			$nomDeco->ajouterId();
-
 
55
			$nomDeco->ajouterIntitule();
-
 
56
 
-
 
57
			$retenuDeco->ajouterRetenu();
-
 
58
			$retenuDeco->ajouterId();
-
 
59
			$retenuDeco->ajouterIntitule();
-
 
60
			$retenuDeco->ajouterHref();
-
 
61
 
-
 
62
			$rangDeco->ajouterCode();
-
 
63
			$rangDeco->ajouterIntitule();
-
 
64
			$rangDeco->ajouterHref();
-
 
65
 
-
 
66
			$compoDeco->ajouterCompo();
-
 
67
 
-
 
68
			$nomDeco->ajouterAuteur();
-
 
69
			$nomDeco->ajouterAnnee();
-
 
70
			$nomDeco->ajouterBiblio();
34
 
71
			$nomDeco->ajouterAddendum();
35
		$basioDeco = new NomBasionymeDecorateur($nomDeco, $this->detailsHrefTpl);
72
			$nomDeco->ajouterNotes();
Line -... Line 73...
-
 
73
 
-
 
74
			$basioDeco->ajouterId();
-
 
75
			$basioDeco->ajouterIntitule();
-
 
76
			$basioDeco->ajouterHref();
-
 
77
 
-
 
78
			$projetDeco->ajouterChampsSupplementaires();
-
 
79
		}
-
 
80
		return $nomDeco->getNomFormate();
-
 
81
	}
-
 
82
 
-
 
83
	public function formaterListe() {
-
 
84
		$nomDeco = new NomDecorateur($this->nomAFormater, $this->detailsHrefTpl);
-
 
85
		$nomDeco->ajouterIntitule();
-
 
86
 
-
 
87
		$retenuDeco = new NomRetenuDecorateur($nomDeco, $this->detailsHrefTpl);
-
 
88
		$retenuDeco->ajouterRetenu();
-
 
89
 
-
 
90
		$nomDeco->ajouterHref();
-
 
91
 
-
 
92
		if ($this->avoirDemandeChampsRetour()) {
-
 
93
			$this->decorateurs[] = $nomDeco;
-
 
94
			$this->decorateurs[] = $retenuDeco;
-
 
95
 
-
 
96
			$this->decorateurs[] = new NomRangDecorateur($nomDeco, $this->bdd, $this->ontologieHrefTpl);
-
 
97
			$this->decorateurs[] = new NomCompoDecorateur($nomDeco);
-
 
98
			$this->decorateurs[] = new NomBasionymeDecorateur($nomDeco, $this->detailsHrefTpl);
-
 
99
			$this->decorateurs[] = new NomChampsProjetDecorateur($nomDeco, $this->champsProjet);
-
 
100
 
-
 
101
			$this->traiterChampsRetour();
-
 
102
		}
-
 
103
 
-
 
104
		return $nomDeco->getNomFormate();
-
 
105
	}
-
 
106
 
-
 
107
	private function avoirDemandeChampsRetour() {
-
 
108
		$demande = true;
-
 
109
		if ($this->champsRetour === null || count($this->champsRetour) == 0) {
-
 
110
			$demande = false;
-
 
111
		}
-
 
112
		return $demande;
36
		$basioDeco->ajouterId();
113
	}
37
		$basioDeco->ajouterIntitule();
114
 
38
		$basioDeco->ajouterHref();
115
	private function traiterChampsRetour() {