Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 954 Rev 957
Line 67... Line 67...
67
	}
67
	}
Line 68... Line 68...
68
	
68
	
69
	private function aMethodeDescription($base) {
69
	private function aMethodeDescription($base) {
70
		return method_exists($this, 'get'.$base);
70
		return method_exists($this, 'get'.$base);
-
 
71
	}
-
 
72
	
-
 
73
	public function getBloc() {
-
 
74
		// prend la première description disponible dans l'ordre indiqué dans le fichier
-
 
75
		// de config, et prend la description wiki sinon	
-
 
76
		if(Config::get($this->referentiel.'.baseDescription') != "") {
-
 
77
			$bases_descriptions = Config::get($this->referentiel.'.baseDescription');
-
 
78
			$bases_descriptions = explode(',',$bases_descriptions);
-
 
79
			foreach($bases_descriptions as $base) {
-
 
80
				if($this->aMethodeDescription($base)) {
-
 
81
					$fonction = 'get'.ucfirst($base);
-
 
82
					$this->$fonction();
-
 
83
					if(!empty($this->donnees[$base]['description'])) {
-
 
84
						$this->donnees['titre'] = "Description de ".ucfirst($base);
-
 
85
						$this->donnees['description'] = $this->donnees[$base]['description'];
-
 
86
						break;
-
 
87
					}
-
 
88
				}
-
 
89
			}
-
 
90
		}
-
 
91
	
-
 
92
		if (empty($this->donnees['description'])) {
-
 
93
			$description = $this->getWikini();
-
 
94
			$this->donnees['description'] = $description['description'];
-
 
95
			$this->donnees['titre'] = "Description collaborative";
-
 
96
		}
-
 
97
	
-
 
98
		return $this->donnees;
Line 71... Line 99...
71
	}
99
	}
72
 
100
 
73
	private function getBaseflor() {
101
	private function getBaseflor() {
74
		$baseflor = array();
102
		$baseflor = array();
Line 111... Line 139...
111
			}
139
			}
112
		}
140
		}
113
		return $chaine;
141
		return $chaine;
114
	}
142
	}
Line 115... Line -...
115
 
-
 
116
 
-
 
117
	public function getBloc() {
-
 
118
		$description = $this->getCoste();
-
 
119
		$donnees['titre'] = "Description de Coste";
-
 
120
		if (empty($description['description'])) {
-
 
121
			$description = $this->getBaseflor(false);
-
 
122
			$donnees['titre'] = "Description Baseflor";
-
 
123
		}
-
 
124
		if (empty($description['description'])) {
-
 
125
			$description = $this->getWikini();
-
 
126
			$donnees['titre'] = "Description collaborative";
-
 
127
		}
-
 
128
		$donnees['description'] = $description['description'];
-
 
129
		return $donnees;
-
 
130
	}
-
 
131
 
143
 
132
	public function getWikipedia() {
144
	public function getWikipedia() {
133
		$wp = array();
145
		$wp = array();
134
		$this->textes->setProjet('wikipedia');
146
		$this->textes->setProjet('wikipedia');
135
		$this->textes->setId($this->getIdWp());
147
		$this->textes->setId($this->getIdWp());
Line 243... Line 255...
243
				$this->CosteFormate['fructification'] = str_replace($retour[1],'',$this->CosteFormate['fructification']);
255
				$this->CosteFormate['fructification'] = str_replace($retour[1],'',$this->CosteFormate['fructification']);
244
				$this->CosteFormate['fructification'] = str_replace('.','',$this->CosteFormate['fructification']);
256
				$this->CosteFormate['fructification'] = str_replace('.','',$this->CosteFormate['fructification']);
245
			}
257
			}
246
		}
258
		}
247
	}
259
	}
248
 
-
 
249
 
-
 
250
}
260
}
251
?>
261
?>
252
262