Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 204 | Go to most recent revision | Show entire file | Regard 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 -... Line 13...
-
 
13
		$this->nomAFormater = $nomDO;
-
 
14
	}
-
 
15
 
-
 
16
	public function setChampsRetour(Array $champsRetour) {
-
 
17
		$this->champsRetour = $champsRetour;
-
 
18
	}
-
 
19
 
-
 
20
	public function setChampsProjet(Array $champsProjet) {
-
 
21
		$this->champsProjet = $champsProjet;
-
 
22
	}
-
 
23
 
-
 
24
	public function setDetailsHrefTpl($tpl) {
-
 
25
		$this->detailsHrefTpl = $tpl;
-
 
26
	}
-
 
27
 
-
 
28
	public function setBdd($bdd) {
-
 
29
		$this->bdd = $bdd;
-
 
30
	}
-
 
31
 
-
 
32
	public function setOntologieHrefTpl($tpl) {
7
		$this->nomAFormater = $nomDO;
33
		$this->ontologieHrefTpl = $tpl;
8
	}
34
	}
-
 
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;
9
 
51
 
10
	public function formater() {
52
			$this->traiterChampsRetour();
Line 11... Line -...
11
		$nomDeco = new NomDecorateur($this->nomAFormater);
-
 
12
		$nomDeco->ajouterId();
53
		} else {
13
		$nomDeco->ajouterIntitule();
54
			$nomDeco->ajouterId();
14
 
55
			$nomDeco->ajouterIntitule();
15
		$retenuDeco = new NomRetenuDecorateur($nomDeco, $this->detailsHrefTpl);
56
 
Line 16... Line -...
16
		$retenuDeco->ajouterRetenu();
-
 
17
		$retenuDeco->ajouterId();
57
			$retenuDeco->ajouterRetenu();
18
		$retenuDeco->ajouterIntitule();
58
			$retenuDeco->ajouterId();
19
		$retenuDeco->ajouterHref();
59
			$retenuDeco->ajouterIntitule();
Line 20... Line -...
20
 
-
 
21
		$rangDeco = new NomRangDecorateur($nomDeco, $this->bdd, $this->ontologieHrefTpl);
60
			$retenuDeco->ajouterHref();
Line 22... Line 61...
22
		$rangDeco->ajouterCode();
61
 
23
		$rangDeco->ajouterIntitule();
62
			$rangDeco->ajouterCode();
24
		$rangDeco->ajouterHref();
63
			$rangDeco->ajouterIntitule();
25
 
64
			$rangDeco->ajouterHref();
26
		$compoDeco = new NomCompoDecorateur($nomDeco);
65
 
Line 27... Line -...
27
		$compoDeco->ajouterCompo();
-
 
28
 
66
			$compoDeco->ajouterCompo();
29
		$nomDeco->ajouterAuteur();
67
 
30
		$nomDeco->ajouterAnnee();
68
			$nomDeco->ajouterAuteur();
Line 31... Line -...
31
		$nomDeco->ajouterBiblio();
-
 
32
		$nomDeco->ajouterAddendum();
69
			$nomDeco->ajouterAnnee();
-
 
70
			$nomDeco->ajouterBiblio();
-
 
71
			$nomDeco->ajouterAddendum();
-
 
72
			$nomDeco->ajouterNotes();
-
 
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;
Line 33... Line 94...
33
		$nomDeco->ajouterNotes();
94
			$this->decorateurs[] = $retenuDeco;
34
 
95
 
Line -... Line 96...
-
 
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
		}
35
		$basioDeco = new NomBasionymeDecorateur($nomDeco, $this->detailsHrefTpl);
112
		return $demande;
36
		$basioDeco->ajouterId();
113
	}
37
		$basioDeco->ajouterIntitule();
114